aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/tui-source.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c
index 4368c04..52b6f41 100644
--- a/gdb/tui/tui-source.c
+++ b/gdb/tui/tui-source.c
@@ -63,9 +63,10 @@ tui_set_source_content (struct symtab *s,
{
if (!noerror)
{
- char *name = alloca (strlen (s->filename) + 100);
+ const char *filename = symtab_to_filename_for_display (s);
+ char *name = alloca (strlen (filename) + 100);
- sprintf (name, "%s:%d", s->filename, line_no);
+ sprintf (name, "%s:%d", filename, line_no);
print_sys_errmsg (name, errno);
}
ret = TUI_FAILURE;
@@ -78,14 +79,16 @@ tui_set_source_content (struct symtab *s,
if (line_no < 1 || line_no > s->nlines)
{
close (desc);
- printf_unfiltered (
- "Line number %d out of range; %s has %d lines.\n",
- line_no, s->filename, s->nlines);
+ printf_unfiltered ("Line number %d out of range; "
+ "%s has %d lines.\n",
+ line_no,
+ symtab_to_filename_for_display (s),
+ s->nlines);
}
else if (lseek (desc, s->line_charpos[line_no - 1], 0) < 0)
{
close (desc);
- perror_with_name (s->filename);
+ perror_with_name (symtab_to_filename_for_display (s));
}
else
{
@@ -94,10 +97,11 @@ tui_set_source_content (struct symtab *s,
= tui_locator_win_info_ptr ();
struct tui_source_info *src
= &TUI_SRC_WIN->detail.source_info;
+ const char *s_filename = symtab_to_filename_for_display (s);
if (TUI_SRC_WIN->generic.title)
xfree (TUI_SRC_WIN->generic.title);
- TUI_SRC_WIN->generic.title = xstrdup (s->filename);
+ TUI_SRC_WIN->generic.title = xstrdup (s_filename);
xfree (src->fullname);
src->fullname = xstrdup (symtab_to_fullname (s));