Support .dwp with the name of symlinked binary file

gdb/
2013-09-24  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* dwarf2read.c (open_and_init_dwp_file): Try open_dwp_file also with
	objfile->original_name.

gdb/testsuite/
2013-09-24  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.dwarf2/dwp-symlink.c: New file.
	* gdb.dwarf2/dwp-symlink.exp: New file.
This commit is contained in:
Jan Kratochvil
2013-09-24 14:03:43 +00:00
parent 24ba069af8
commit 82bf32bc61
5 changed files with 121 additions and 1 deletions

View File

@@ -9648,10 +9648,21 @@ open_and_init_dwp_file (void)
bfd *dbfd;
struct cleanup *cleanups;
dwp_name = xstrprintf ("%s.dwp", objfile_name (dwarf2_per_objfile->objfile));
/* Try to find first .dwp for the binary file before any symbolic links
resolving. */
dwp_name = xstrprintf ("%s.dwp", objfile->original_name);
cleanups = make_cleanup (xfree, dwp_name);
dbfd = open_dwp_file (dwp_name);
if (dbfd == NULL
&& strcmp (objfile->original_name, objfile_name (objfile)) != 0)
{
/* Try to find .dwp for the binary file after gdb_realpath resolving. */
dwp_name = xstrprintf ("%s.dwp", objfile_name (objfile));
make_cleanup (xfree, dwp_name);
dbfd = open_dwp_file (dwp_name);
}
if (dbfd == NULL)
{
if (dwarf2_read_debug)