[gdb] Print user for maint info psymtabs
authorTom de Vries <tdevries@suse.de>
Tue, 24 Mar 2020 09:00:51 +0000 (10:00 +0100)
committerTom de Vries <tdevries@suse.de>
Tue, 24 Mar 2020 09:00:51 +0000 (10:00 +0100)
The type struct partial_symtab contains two fields (disregarding field next)
that express relations with other symtabs: user and dependencies.

When using "maint print psymbols", we see both the dependencies and the user
fields:
...
Partial symtab for source file  (object 0x35ef270)
  ...
  Depends on 0 other partial symtabs.
  Shared partial symtab with user 0x35d5f40
...

But with "maint info psymtabs", we only see dependencies:
...
  { psymtab  ((struct partial_symtab *) 0x35ef270)
    ...
    dependencies (none)
  }
...

Add printing of the user field for "maint info psymtabs", such that we have:
...
   { psymtab  ((struct partial_symtab *) 0x35ef270)
     ...
+    user hello.c ((struct partial_symtab *) 0x35d5f40)
     dependencies (none)
   }
...

Tested on x86_64-linux.

gdb/ChangeLog:

2020-03-24  Tom de Vries  <tdevries@suse.de>

* psymtab.c (maintenance_info_psymtabs): Print user field.

gdb/ChangeLog
gdb/psymtab.c

index 186660bf9ffe937e3f6dadae102c868801924f20..1acd1fddc92f0c4c2946a75bbb79ed22e3e8c4c8 100644 (file)
@@ -1,3 +1,7 @@
+2020-03-24  Tom de Vries  <tdevries@suse.de>
+
+       * psymtab.c (maintenance_info_psymtabs): Print user field.
+
 2020-03-20  Tom Tromey  <tromey@adacore.com>
 
        * dwarf2/loc.h (dwarf2_evaluate_property): Make "addr_stack"
index f77f6d5108fecd8fa0b5b0e3508a4402089a0619..8aa9c6e87bb57b7c8317bc99e3fe261659868f4c 100644 (file)
@@ -2065,6 +2065,11 @@ maintenance_info_psymtabs (const char *regexp, int from_tty)
                  }
                else
                  printf_filtered ("(none)\n");
+               if (psymtab->user)
+                 printf_filtered ("    user %s "
+                                  "((struct partial_symtab *) %s)\n",
+                                  psymtab->user->filename,
+                                  host_address_to_string (psymtab->user));
                printf_filtered ("    dependencies ");
                if (psymtab->number_of_dependencies)
                  {