diff options
Diffstat (limited to 'gdb/source.c')
-rw-r--r-- | gdb/source.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gdb/source.c b/gdb/source.c index 020e94d..2025c93 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -713,8 +713,8 @@ info_source_command (const char *ignore, int from_tty) cust = s->compunit (); gdb_printf (_("Current source file is %s\n"), s->filename); - if (s->dirname () != NULL) - gdb_printf (_("Compilation directory is %s\n"), s->dirname ()); + if (s->compunit ()->dirname () != NULL) + gdb_printf (_("Compilation directory is %s\n"), s->compunit ()->dirname ()); if (s->fullname) gdb_printf (_("Located in %s\n"), s->fullname); const std::vector<off_t> *offsets; @@ -1180,7 +1180,7 @@ open_source_file (struct symtab *s) gdb::unique_xmalloc_ptr<char> fullname (s->fullname); s->fullname = NULL; - scoped_fd fd = find_and_open_source (s->filename, s->dirname (), + scoped_fd fd = find_and_open_source (s->filename, s->compunit ()->dirname (), &fullname); if (fd.get () < 0) @@ -1192,9 +1192,9 @@ open_source_file (struct symtab *s) std::string srcpath; if (IS_ABSOLUTE_PATH (s->filename)) srcpath = s->filename; - else if (s->dirname () != nullptr) + else if (s->compunit ()->dirname () != nullptr) { - srcpath = s->dirname (); + srcpath = s->compunit ()->dirname (); srcpath += SLASH_STRING; srcpath += s->filename; } @@ -1268,10 +1268,11 @@ symtab_to_fullname (struct symtab *s) /* rewrite_source_path would be applied by find_and_open_source, we should report the pathname where GDB tried to find the file. */ - if (s->dirname () == NULL || IS_ABSOLUTE_PATH (s->filename)) + if (s->compunit ()->dirname () == nullptr + || IS_ABSOLUTE_PATH (s->filename)) fullname.reset (xstrdup (s->filename)); else - fullname.reset (concat (s->dirname (), SLASH_STRING, + fullname.reset (concat (s->compunit ()->dirname (), SLASH_STRING, s->filename, (char *) NULL)); s->fullname = rewrite_source_path (fullname.get ()).release (); |