aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2/sect-names.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-03-06 09:26:39 -0700
committerTom Tromey <tom@tromey.com>2021-03-06 09:26:39 -0700
commitfbedd54644116109834c0e0546e6c32ae3c482f9 (patch)
tree107ffc8f08893b768ce9091f32a0404a20fa20af /gdb/dwarf2/sect-names.h
parentc2a62a3d8833b824e8f0e36b6a03f348d7d1cd5a (diff)
downloadgdb-fbedd54644116109834c0e0546e6c32ae3c482f9.zip
gdb-fbedd54644116109834c0e0546e6c32ae3c482f9.tar.gz
gdb-fbedd54644116109834c0e0546e6c32ae3c482f9.tar.bz2
Change section_is_p to a method on dwarf2_section_names
This replaces section_is_p with a method on dwarf2_section_names. gdb/ChangeLog 2021-03-06 Tom Tromey <tom@tromey.com> * dwarf2/sect-names.h (struct dwarf2_section_names) <matches>: New method. * dwarf2/read.c (section_is_p): Remove. (dwarf2_per_bfd::locate_sections) (dwarf2_per_bfd::locate_sections, locate_dwz_sections) (locate_v1_virtual_dwo_sections, dwarf2_locate_dwo_sections) (dwarf2_locate_common_dwp_sections) (dwarf2_locate_v2_dwp_sections, dwarf2_locate_v5_dwp_sections): Update.
Diffstat (limited to 'gdb/dwarf2/sect-names.h')
-rw-r--r--gdb/dwarf2/sect-names.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/dwarf2/sect-names.h b/gdb/dwarf2/sect-names.h
index 63cf2ca..b753283 100644
--- a/gdb/dwarf2/sect-names.h
+++ b/gdb/dwarf2/sect-names.h
@@ -31,6 +31,13 @@
struct dwarf2_section_names {
const char *normal;
const char *compressed;
+
+ /* Return true if NAME matches either of this section's names. */
+ bool matches (const char *name) const
+ {
+ return ((normal != nullptr && strcmp (name, normal) == 0)
+ || (compressed != nullptr && strcmp (name, compressed) == 0));
+ }
};
/* List of names for dward2 debugging sections. Also most object file formats