public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb: small "maintenance info line-table" readability improvements
@ 2021-12-02  1:40 Simon Marchi
  2021-12-02 17:15 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi @ 2021-12-02  1:40 UTC (permalink / raw)
  To: gdb-patches

 - separate each entry with a newline, to visually separate them
 - style filenames with the filename style
 - print the name of the compunit_symtab

A header now looks like this, with the compunit_symtab name added (and
the coloring, but you can't really see it here):

    objfile: /home/simark/build/babeltrace/src/cli/.libs/babeltrace2 ((struct objfile *) 0x613000005980)
    compunit_symtab: babeltrace2-cfg-cli-args.c ((struct compunit_symtab *) 0x62100da1ed10)
    symtab: /usr/include/glib-2.0/glib/gdatetime.h ((struct symtab *) 0x62100d9ee530)
    linetable: ((struct linetable *) 0x0):

Change-Id: Idc23e10aaa66e2e692adb0a6a74144f72c4fa1c7
---
 gdb/symmisc.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index e38ceb6bda12..7e215595cd83 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -37,6 +37,7 @@
 #include "gdbcmd.h"
 #include "source.h"
 #include "readline/tilde.h"
+#include <cli/cli-style.h>
 
 /* Prototypes for local functions */
 
@@ -966,13 +967,16 @@ maintenance_print_one_line_table (struct symtab *symtab, void *data)
   struct objfile *objfile;
 
   objfile = symtab->compunit_symtab->objfile;
-  printf_filtered (_("objfile: %s ((struct objfile *) %s)\n"),
-		   objfile_name (objfile),
+  printf_filtered (_("objfile: %ps ((struct objfile *) %s)\n"),
+		   styled_string (file_name_style.style (),
+				  objfile_name (objfile)),
 		   host_address_to_string (objfile));
-  printf_filtered (_("compunit_symtab: ((struct compunit_symtab *) %s)\n"),
+  printf_filtered (_("compunit_symtab: %s ((struct compunit_symtab *) %s)\n"),
+		   symtab->compunit_symtab->name,
 		   host_address_to_string (symtab->compunit_symtab));
-  printf_filtered (_("symtab: %s ((struct symtab *) %s)\n"),
-		   symtab_to_fullname (symtab),
+  printf_filtered (_("symtab: %ps ((struct symtab *) %s)\n"),
+		   styled_string (file_name_style.style (),
+				  symtab_to_fullname (symtab)),
 		   host_address_to_string (symtab));
   linetable = SYMTAB_LINETABLE (symtab);
   printf_filtered (_("linetable: ((struct linetable *) %s):\n"),
@@ -1036,7 +1040,10 @@ maintenance_info_line_tables (const char *regexp, int from_tty)
 
 		if (regexp == NULL
 		    || re_exec (symtab_to_filename_for_display (symtab)))
-		  maintenance_print_one_line_table (symtab, NULL);
+		  {
+		    maintenance_print_one_line_table (symtab, NULL);
+		    printf_filtered ("\n");
+		  }
 	      }
 	  }
       }
-- 
2.33.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gdb: small "maintenance info line-table" readability improvements
  2021-12-02  1:40 [PATCH] gdb: small "maintenance info line-table" readability improvements Simon Marchi
@ 2021-12-02 17:15 ` Tom Tromey
  2021-12-03 21:52   ` Simon Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2021-12-02 17:15 UTC (permalink / raw)
  To: Simon Marchi via Gdb-patches

>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon>  - separate each entry with a newline, to visually separate them
Simon>  - style filenames with the filename style
Simon>  - print the name of the compunit_symtab

This looks reasonable to me.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gdb: small "maintenance info line-table" readability improvements
  2021-12-02 17:15 ` Tom Tromey
@ 2021-12-03 21:52   ` Simon Marchi
  0 siblings, 0 replies; 3+ messages in thread
From: Simon Marchi @ 2021-12-03 21:52 UTC (permalink / raw)
  To: Tom Tromey, Simon Marchi via Gdb-patches



On 2021-12-02 12:15, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Simon>  - separate each entry with a newline, to visually separate them
> Simon>  - style filenames with the filename style
> Simon>  - print the name of the compunit_symtab
> 
> This looks reasonable to me.
> 
> Tom
> 

Thanks, pushed.

Simon

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-03 21:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-02  1:40 [PATCH] gdb: small "maintenance info line-table" readability improvements Simon Marchi
2021-12-02 17:15 ` Tom Tromey
2021-12-03 21:52   ` 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).