Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [committed][gdb] Print user for maint info psymtabs
@ 2020-03-24  9:01 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2020-03-24  9:01 UTC (permalink / raw)
  To: gdb-patches

Hi,

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.

Committed to trunk.

Thanks,
- Tom

[gdb] Print user for maint info psymtabs

gdb/ChangeLog:

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

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

---
 gdb/psymtab.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index f77f6d5108..8aa9c6e87b 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -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)
 		  {


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

only message in thread, other threads:[~2020-03-24  9:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-24  9:01 [committed][gdb] Print user for maint info psymtabs Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox