aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2/attribute.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-09-29 18:49:08 -0600
committerTom Tromey <tom@tromey.com>2020-09-29 20:29:07 -0600
commitc45bc3f8ab3b657912f07c7823ad58ba4f9fe3f1 (patch)
tree55be6e129866a307e1bef72ac798a364dec32b9e /gdb/dwarf2/attribute.h
parent23dca5c3d77252ad8000d749b4457f7e286b8367 (diff)
downloadgdb-c45bc3f8ab3b657912f07c7823ad58ba4f9fe3f1.zip
gdb-c45bc3f8ab3b657912f07c7823ad58ba4f9fe3f1.tar.gz
gdb-c45bc3f8ab3b657912f07c7823ad58ba4f9fe3f1.tar.bz2
Add attribute::as_boolean method
This adds a new attribute::as_boolean method, and updates the reader to use it. The main benefit of this change is that now the code will respect the attribute's form. gdb/ChangeLog 2020-09-29 Tom Tromey <tom@tromey.com> * dwarf2/read.c (read_func_scope, prototyped_function_p) (read_subroutine_type, partial_die_info::read) (dwarf2_flag_true_p, new_symbol, dump_die_shallow) (dwarf2_add_member_fn): Update. * dwarf2/attribute.h (struct attribute) <as_boolean>: Declare. * dwarf2/attribute.c (attribute::as_boolean): New method.
Diffstat (limited to 'gdb/dwarf2/attribute.h')
-rw-r--r--gdb/dwarf2/attribute.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/dwarf2/attribute.h b/gdb/dwarf2/attribute.h
index 8890fdb..f8969c9 100644
--- a/gdb/dwarf2/attribute.h
+++ b/gdb/dwarf2/attribute.h
@@ -263,6 +263,10 @@ struct attribute
issue a complaint and return DW_VIRTUALITY_none. */
dwarf_virtuality_attribute as_virtuality () const;
+ /* Return the attribute's value as a boolean. An unrecognized form
+ will issue a complaint and return false. */
+ bool as_boolean () const;
+
ENUM_BITFIELD(dwarf_attribute) name : 15;
/* A boolean that is used for forms that require reprocessing. A