public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb: print compunit_symtab name in "maint info symtabs"
@ 2022-04-01  1:34 Simon Marchi
  0 siblings, 0 replies; only message in thread
From: Simon Marchi @ 2022-04-01  1:34 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=af7047e8589d198229f6f657c3bef04969036d21

commit af7047e8589d198229f6f657c3bef04969036d21
Author: Simon Marchi <simon.marchi@polymtl.ca>
Date:   Thu Mar 31 17:20:18 2022 -0400

    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

Diff:
---
 gdb/symmisc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 37ecc8064da..d33ea0fed9a 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)"));


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-01  1:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-01  1:34 [binutils-gdb] gdb: print compunit_symtab name in "maint info symtabs" Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).