aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.h
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2020-03-25 12:38:05 +0100
committerTom de Vries <tdevries@suse.de>2020-03-25 12:38:05 +0100
commit7b1eff95bed765cb20dd3168cb99896a91fcdca7 (patch)
treea9f9a6269d4e3ab29b8c26c5323d1ae1cd3528fc /gdb/symtab.h
parentdd8953924b0966e363c27ee38a0663c08f742fa0 (diff)
downloadgdb-7b1eff95bed765cb20dd3168cb99896a91fcdca7.zip
gdb-7b1eff95bed765cb20dd3168cb99896a91fcdca7.tar.gz
gdb-7b1eff95bed765cb20dd3168cb99896a91fcdca7.tar.bz2
[gdb] Print user/includes fields for maint commands
The type struct compunit_symtab contains two fields (disregarding field next) that express relations with other compunit_symtabs: user and includes. These fields are currently not printed with "maint info symtabs" and "maint print symbols". Fix this such that for "maint info symtabs" we print: ... { ((struct compunit_symtab *) 0x23e8450) debugformat DWARF 2 producer (null) dirname (null) blockvector ((struct blockvector *) 0x23e8590) + user ((struct compunit_symtab *) 0x2336280) + ( includes + ((struct compunit_symtab *) 0x23e85e0) + ((struct compunit_symtab *) 0x23e8960) + ) { symtab <unknown> ((struct symtab *) 0x23e85b0) fullname (null) linetable ((struct linetable *) 0x0) } } ... And for "maint print symbols" we print: ... -Symtab for file <unknown> +Symtab for file <unknown> at 0x23e85b0 Read from object file /data/gdb_versions/devel/a.out (0x233ccf0) Language: c Blockvector: block #000, object at 0x23e8530, 0 syms/buckets in 0x0..0x0 block #001, object at 0x23e84d0 under 0x23e8530, 0 syms/buckets in 0x0..0x0 +Compunit user: 0x2336300 +Compunit include: 0x23e8900 +Compunit include: 0x23dd970 ... Note: for user and includes we don't list the actual compunit_symtab address, but instead the corresponding symtab address, which allows us to find that symtab elsewhere in the output (given that we also now print the address of symtabs). gdb/ChangeLog: 2020-03-25 Tom de Vries <tdevries@suse.de> * symtab.h (is_main_symtab_of_compunit_symtab): New function. * symmisc.c (dump_symtab_1): Print user and includes fields. (maintenance_info_symtabs): Same.
Diffstat (limited to 'gdb/symtab.h')
-rw-r--r--gdb/symtab.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 771b5ec..18be5d5 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1513,6 +1513,13 @@ extern struct symtab *
extern enum language compunit_language (const struct compunit_symtab *cust);
+/* Return true if this symtab is the "main" symtab of its compunit_symtab. */
+
+static inline bool
+is_main_symtab_of_compunit_symtab (struct symtab *symtab)
+{
+ return symtab == COMPUNIT_FILETABS (SYMTAB_COMPUNIT (symtab));
+}
/* The virtual function table is now an array of structures which have the