summaryrefslogtreecommitdiff
path: root/gdb/source.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2013-03-14 14:35:12 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2013-03-14 14:35:12 +0000
commit76993b3415743a4bb46d80aa10af8754cdb93a7f (patch)
tree5a79e64bb18c7bf0d1cf76f0c3b7509bf6bad758 /gdb/source.c
parentae7f3bbb9fed17d911cd402f26077b9caca2a03d (diff)
downloadgdb-76993b3415743a4bb46d80aa10af8754cdb93a7f.tar.gz
gdb/
* source.c (print_source_lines_base): Suppress "file" for TUI.
Diffstat (limited to 'gdb/source.c')
-rw-r--r--gdb/source.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gdb/source.c b/gdb/source.c
index f5949e6ee88..b154dfe6177 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -1344,11 +1344,15 @@ print_source_lines_base (struct symtab *s, int line, int stopline,
{
ui_out_field_int (uiout, "line", line);
ui_out_text (uiout, "\tin ");
- ui_out_field_string (uiout, "file",
- symtab_to_filename_for_display (s));
- /* TUI expects the "fullname" field. While it is
- !ui_out_is_mi_like_p compared to CLI it is !ui_source_list. */
+ /* CLI expects only the "file" field. TUI expects only the
+ "fullname" field (and TUI does break if "file" is printed).
+ MI expects both fields. ui_source_list is set only for CLI,
+ not for TUI. */
+ if (ui_out_is_mi_like_p (uiout)
+ || ui_out_test_flags (uiout, ui_source_list))
+ ui_out_field_string (uiout, "file",
+ symtab_to_filename_for_display (s));
if (ui_out_is_mi_like_p (uiout)
|| !ui_out_test_flags (uiout, ui_source_list))
{
@@ -1356,6 +1360,7 @@ print_source_lines_base (struct symtab *s, int line, int stopline,
ui_out_field_string (uiout, "fullname", fullname);
}
+
ui_out_text (uiout, "\n");
}