PR ld/12549
[binutils-gdb.git] / gdb / source.c
index 45140fc7ce2cc78ca05977f8bc19f8bbfa8b17f0..f5949e6ee88ba5c2b07931e6530758bb6afe1654 100644 (file)
@@ -954,7 +954,7 @@ get_substitute_path_rule (const char *path)
    Return NULL if no substitution rule was specified by the user,
    or if no rule applied to the given PATH.  */
    
-static char *
+char *
 rewrite_source_path (const char *path)
 {
   const struct substitute_path_rule *rule = get_substitute_path_rule (path);
@@ -1346,7 +1346,11 @@ print_source_lines_base (struct symtab *s, int line, int stopline,
          ui_out_text (uiout, "\tin ");
          ui_out_field_string (uiout, "file",
                               symtab_to_filename_for_display (s));
-         if (ui_out_is_mi_like_p (uiout))
+
+         /* TUI expects the "fullname" field.  While it is
+            !ui_out_is_mi_like_p compared to CLI it is !ui_source_list.  */
+         if (ui_out_is_mi_like_p (uiout)
+             || !ui_out_test_flags (uiout, ui_source_list))
            {
              const char *fullname = symtab_to_fullname (s);