Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Display full file path in MI style disassembly listing
@ 2012-10-04 16:09 Andrew Burgess
  2012-10-05 12:44 ` Jan Kratochvil
                   ` (3 more replies)
  0 siblings, 4 replies; 27+ messages in thread
From: Andrew Burgess @ 2012-10-04 16:09 UTC (permalink / raw)
  To: gdb-patches

When producing an MI style disassembly listing we use the shorted symtab filename, rather than computing the fullname.  This can make it harder for an MI consumer to figure out which file to open.

The patch below tries to use the fullname when it can, and falls back to the shorter name if it can't figure out the full name.

Ok to apply?

Thanks,
Andrew

gdb/ChangeLog

2012-10-04  Andrew Burhess  <aburgess@broadcom.com>

	* source.c (print_source_lines_base): Display full file name when
	producing MI style disassembly listings.

diff --git a/gdb/source.c b/gdb/source.c
index 31e104f..2a02382 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -1298,9 +1298,19 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
 	}
       else
 	{
+	  char *filename;
+
+	  filename = s->fullname;
+	  if (filename == NULL)
+	    {
+	      filename = symtab_to_fullname (s);
+	      if (filename == NULL)
+		filename = s->filename;
+	    }
+
 	  ui_out_field_int (uiout, "line", line);
 	  ui_out_text (uiout, "\tin ");
-	  ui_out_field_string (uiout, "file", s->filename);
+	  ui_out_field_string (uiout, "file", filename);
 	  ui_out_text (uiout, "\n");
 	}
 


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

end of thread, other threads:[~2012-11-09 13:26 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-04 16:09 [PATCH] Display full file path in MI style disassembly listing Andrew Burgess
2012-10-05 12:44 ` Jan Kratochvil
2012-10-07 14:28   ` Andrew Burgess
2012-10-07 14:34     ` Jan Kratochvil
2012-10-07 15:16       ` Joel Brobecker
2012-10-17 17:20         ` Tom Tromey
2012-10-17 18:13   ` Pedro Alves
2012-10-18  6:48     ` Jan Kratochvil
2012-10-18  9:49       ` Andrew Burgess
2012-10-18 10:17         ` Pedro Alves
2012-10-18 18:06           ` André Pönitz
2012-10-18 13:45         ` Jan Kratochvil
2012-10-17 17:16 ` Tom Tromey
2012-10-18  9:34   ` Andrew Burgess
2012-10-18 13:45     ` Jan Kratochvil
2012-10-17 18:25 ` Pedro Alves
2012-10-22 21:26 ` Add fullname field in disassembly output (Was Re: [PATCH] Display full file path in MI style disassembly listing) Andrew Burgess
2012-10-31 14:54   ` Add fullname field in disassembly output Pedro Alves
2012-11-02 10:59     ` Andrew Burgess
2012-11-02 15:32       ` Pedro Alves
2012-11-06 12:14         ` Andrew Burgess
2012-11-06 17:44           ` Eli Zaretskii
2012-11-07 15:08             ` Andrew Burgess
2012-11-07 15:48               ` Pedro Alves
2012-11-08 21:30                 ` Tom Tromey
2012-11-09 13:26                   ` Andrew Burgess
2012-11-03  7:42       ` Eli Zaretskii

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