From owner-svn-src-projects@FreeBSD.ORG Sat Jan 18 17:59:23 2014 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 448F8EB9; Sat, 18 Jan 2014 17:59:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 16F5113C1; Sat, 18 Jan 2014 17:59:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0IHxMOn067716; Sat, 18 Jan 2014 17:59:22 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0IHxMJK067711; Sat, 18 Jan 2014 17:59:22 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201401181759.s0IHxMJK067711@svn.freebsd.org> From: Kai Wang Date: Sat, 18 Jan 2014 17:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r260855 - projects/elftoolchain/contrib/elftoolchain/libdwarf X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jan 2014 17:59:23 -0000 Author: kaiw Date: Sat Jan 18 17:59:22 2014 New Revision: 260855 URL: http://svnweb.freebsd.org/changeset/base/260855 Log: API dwarf_attrval_flag() should properly handle an attribute with (DWARF4) form DW_FORM_flag_present which implicitly indicates the presence of the attribute. Manual page is updated to reflect this change. Note that this was previously fixed in the old libdwarf. Modified: projects/elftoolchain/contrib/elftoolchain/libdwarf/dwarf_attrval.c projects/elftoolchain/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3 Modified: projects/elftoolchain/contrib/elftoolchain/libdwarf/dwarf_attrval.c ============================================================================== --- projects/elftoolchain/contrib/elftoolchain/libdwarf/dwarf_attrval.c Sat Jan 18 17:49:32 2014 (r260854) +++ projects/elftoolchain/contrib/elftoolchain/libdwarf/dwarf_attrval.c Sat Jan 18 17:59:22 2014 (r260855) @@ -50,6 +50,7 @@ dwarf_attrval_flag(Dwarf_Die die, Dwarf_ switch (at->at_form) { case DW_FORM_flag: + case DW_FORM_flag_present: *valp = (Dwarf_Bool) (!!at->u[0].u64); break; default: Modified: projects/elftoolchain/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3 ============================================================================== --- projects/elftoolchain/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3 Sat Jan 18 17:49:32 2014 (r260854) +++ projects/elftoolchain/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3 Sat Jan 18 17:59:22 2014 (r260855) @@ -24,7 +24,7 @@ .\" .\" $Id: dwarf_attrval_signed.3 2072 2011-10-27 03:26:49Z jkoshy $ .\" -.Dd January 29, 2011 +.Dd January 18, 2014 .Os .Dt DWARF_ATTRVAL_SIGNED 3 .Sh NAME @@ -84,13 +84,28 @@ Function .Fn dwarf_attrval_flag sets the location pointed to by argument .Ar ret -to 1 if the attribute named by argument +to either 0 or 1. If the form of the attribute named by argument .Ar attr -has a non-zero value, or to 0 otherwise. -The form of the attribute named by argument +is +.Dv DW_FORM_flag , +function +.Fn dwarf_attrval_flag +sets the location pointed to by argument +.Ar ret +to 1 if the attribute has a non-zero value, or to 0 otherwise. +If the form of the attribute named by argument .Ar attr -must be -.Dv DW_FORM_flag . +is +.Dv DW_FORM_flag_present , +function +.Fn dwarf_attrval_flag +unconditionally sets the location pointed to by argument +.Ar ret +to 1. +The form of the attribute must be one of +.Dv DW_FORM_flag +or +.Dv DW_FORM_flag_present . .Pp Function .Fn dwarf_attrval_signed @@ -122,7 +137,7 @@ attribute named by argument The form of the attribute must be one of .Dv DW_FORM_string or -.Dv DW_FORM_strp . +.Dv DW_FORM_strp . .Pp Function .Fn dwarf_attrval_unsigned