mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-09-18 15:43:08 +08:00
Record objfile->original_name as an absolute path
gdb/ 2013-12-02 Doug Evans <dje@google.com> Jan Kratochvil <jan.kratochvil@redhat.com> * objfiles.c (allocate_objfile): Save original_name as an absolute path. * objfiles.h (struct objfile): Expand comment on original_name. * source.c (openp): Call gdb_abspath. * utils.c (gdb_abspath): New function. * utils.h (gdb_abspath): Declare. gdb/testsuite/ 2013-12-02 Doug Evans <dje@google.com> * gdb.dwarf/dwp-symlink.c: Fake out gdb to not load debug info at start. * gdb.dwarf/dwp-symlink.exp: Test trying to load dwp when the binary has been specified with a relative path and we have chdir'd before accessing the debug info.
This commit is contained in:
24
gdb/source.c
24
gdb/source.c
@ -853,28 +853,10 @@ done:
|
||||
/* If a file was opened, canonicalize its filename. */
|
||||
if (fd < 0)
|
||||
*filename_opened = NULL;
|
||||
else if ((opts & OPF_RETURN_REALPATH) != 0)
|
||||
*filename_opened = gdb_realpath (filename);
|
||||
else
|
||||
{
|
||||
char *(*realpath_fptr) (const char *);
|
||||
|
||||
realpath_fptr = ((opts & OPF_RETURN_REALPATH) != 0
|
||||
? gdb_realpath : xstrdup);
|
||||
|
||||
if (IS_ABSOLUTE_PATH (filename))
|
||||
*filename_opened = realpath_fptr (filename);
|
||||
else
|
||||
{
|
||||
/* Beware the // my son, the Emacs barfs, the botch that catch... */
|
||||
|
||||
char *f = concat (current_directory,
|
||||
IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1])
|
||||
? "" : SLASH_STRING,
|
||||
filename, (char *)NULL);
|
||||
|
||||
*filename_opened = realpath_fptr (f);
|
||||
xfree (f);
|
||||
}
|
||||
}
|
||||
*filename_opened = gdb_abspath (filename);
|
||||
}
|
||||
|
||||
return fd;
|
||||
|
Reference in New Issue
Block a user