summaryrefslogtreecommitdiff
path: root/gdb/stack.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2013-02-03 16:09:29 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2013-02-03 16:09:29 +0000
commitd4f5987387f1f61969b86ca9305264820ad01499 (patch)
tree3fba27336b665d49484c17b14adf2db7c0f5e038 /gdb/stack.c
parentc73c602ab2e8ff0baf26ca94d9b5f4d442306bbc (diff)
downloadgdb-d4f5987387f1f61969b86ca9305264820ad01499.tar.gz
gdb/
Add a new variable that controls a way in which filenames are displayed. * NEWS (set filename-display): New entry. * source.c (filename_display_basename, filename_display_relative) (filename_display_absolute, filename_display_kind_names) (filename_display_string, show_filename_display_string) (symtab_to_filename_for_display): New. (_initialize_source): Added initialization of 'filename-display' variable. * source.h (symtab_to_filename_for_display): Added declaration. * stack.c (print_frame): Added new variable and calling of a new function and condition with this variable. Changed third argument of calling of a function. gdb/doc/ * gdb.texinfo (Backtrace): Added description of 'filename-display' variable in 'set/show backtrace' section. gdb/testsuite/ * gdb.dwarf2/dw2-dir-file-name.exp: New file. * gdb.dwarf2/dw2-dir-file-name.c: New file.
Diffstat (limited to 'gdb/stack.c')
-rw-r--r--gdb/stack.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/stack.c b/gdb/stack.c
index c8a6a7e5e64..662b351d209 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -1178,11 +1178,14 @@ print_frame (struct frame_info *frame, int print_level,
ui_out_text (uiout, ")");
if (sal.symtab)
{
+ const char *filename_display;
+
+ filename_display = symtab_to_filename_for_display (sal.symtab);
annotate_frame_source_begin ();
ui_out_wrap_hint (uiout, " ");
ui_out_text (uiout, " at ");
annotate_frame_source_file ();
- ui_out_field_string (uiout, "file", sal.symtab->filename);
+ ui_out_field_string (uiout, "file", filename_display);
if (ui_out_is_mi_like_p (uiout))
{
const char *fullname = symtab_to_fullname (sal.symtab);