summaryrefslogtreecommitdiffstats
path: root/contrib/elftoolchain
diff options
context:
space:
mode:
authorkaiw <kaiw@FreeBSD.org>2014-01-18 17:59:22 +0000
committerkaiw <kaiw@FreeBSD.org>2014-01-18 17:59:22 +0000
commit80ef55c0ac0204f2d98380c0255b2f7a609ed8db (patch)
treeeecd4c978728e64dfa91d251e704ab440ad81272 /contrib/elftoolchain
parentde938e3f1716c9eaf863402eed556f53ce34dfc1 (diff)
downloadFreeBSD-src-80ef55c0ac0204f2d98380c0255b2f7a609ed8db.zip
FreeBSD-src-80ef55c0ac0204f2d98380c0255b2f7a609ed8db.tar.gz
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.
Diffstat (limited to 'contrib/elftoolchain')
-rw-r--r--contrib/elftoolchain/libdwarf/dwarf_attrval.c1
-rw-r--r--contrib/elftoolchain/libdwarf/dwarf_attrval_signed.329
2 files changed, 23 insertions, 7 deletions
diff --git a/contrib/elftoolchain/libdwarf/dwarf_attrval.c b/contrib/elftoolchain/libdwarf/dwarf_attrval.c
index 0f17016..31d19f7 100644
--- a/contrib/elftoolchain/libdwarf/dwarf_attrval.c
+++ b/contrib/elftoolchain/libdwarf/dwarf_attrval.c
@@ -50,6 +50,7 @@ dwarf_attrval_flag(Dwarf_Die die, Dwarf_Half attr, Dwarf_Bool *valp, Dwarf_Error
switch (at->at_form) {
case DW_FORM_flag:
+ case DW_FORM_flag_present:
*valp = (Dwarf_Bool) (!!at->u[0].u64);
break;
default:
diff --git a/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3 b/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3
index 9646990..5888d08 100644
--- a/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3
+++ b/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3
@@ -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
OpenPOWER on IntegriCloud