aboutsummaryrefslogtreecommitdiff
path: root/gdb/symmisc.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2022-03-31 17:20:18 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2022-03-31 21:26:53 -0400
commitaf7047e8589d198229f6f657c3bef04969036d21 (patch)
tree01029b3079ac11a067d147293d2cab7df2b56a28 /gdb/symmisc.c
parent8458fb44b45ed25ae08237771fa4ada9a8f463f4 (diff)
downloadgdb-af7047e8589d198229f6f657c3bef04969036d21.zip
gdb-af7047e8589d198229f6f657c3bef04969036d21.tar.gz
gdb-af7047e8589d198229f6f657c3bef04969036d21.tar.bz2
gdb: print compunit_symtab name in "maint info symtabs"
I think it would make sense to print a compunit_symtab's name in "maint info symtabs". If you are looking for a given CU in the list, that's probably the field you will be looking at. As the doc of compunit_symtab::name says, it is not meant to be a reliable file name, it is for debugging purposes (and "maint info symtabs" exists for debugging purposes). Sample output with the new field: (gdb) maintenance info symtabs { objfile /home/simark/build/binutils-gdb-one-target/gdb/a.out ((struct objfile *) 0x613000005d00) { ((struct compunit_symtab *) 0x621000131630) debugformat DWARF 5 producer GNU C17 11.2.0 -mtune=generic -march=x86-64 -g3 -O0 name test.c dirname /home/simark/build/binutils-gdb-one-target/gdb blockvector ((struct blockvector *) 0x621000131d10) user ((struct compunit_symtab *) (null)) { symtab test.c ((struct symtab *) 0x6210001316b0) fullname (null) linetable ((struct linetable *) 0x621000131d40) } { symtab /home/simark/build/binutils-gdb-one-target/gdb/test.h ((struct symtab *) 0x6210001316e0) fullname (null) linetable ((struct linetable *) 0x0) } { symtab /usr/include/stdc-predef.h ((struct symtab *) 0x621000131710) fullname (null) linetable ((struct linetable *) 0x0) } } { ((struct compunit_symtab *) 0x6210001170a0) debugformat DWARF 5 producer GNU C17 11.2.0 -mtune=generic -march=x86-64 -g3 -O0 name foo.c dirname /home/simark/build/binutils-gdb-one-target/gdb blockvector ((struct blockvector *) 0x621000131580) user ((struct compunit_symtab *) (null)) { symtab foo.c ((struct symtab *) 0x621000117120) fullname (null) linetable ((struct linetable *) 0x6210001315b0) } { symtab /usr/include/stdc-predef.h ((struct symtab *) 0x621000117150) fullname (null) linetable ((struct linetable *) 0x0) } } } Change-Id: I17b87adfac2f6551cb5bda30d59f6c6882789211
Diffstat (limited to 'gdb/symmisc.c')
-rw-r--r--gdb/symmisc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 37ecc80..d33ea0f 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -781,6 +781,7 @@ maintenance_info_symtabs (const char *regexp, int from_tty)
gdb_printf (" producer %s\n",
(cust->producer () != nullptr
? cust->producer () : "(null)"));
+ gdb_printf (" name %s\n", cust->name);
gdb_printf (" dirname %s\n",
(cust->dirname () != NULL
? cust->dirname () : "(null)"));