diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2013-09-24 14:03:43 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2013-09-24 14:03:43 +0000 |
commit | 82bf32bc61ee1f2652fa848fe37b4e18429661c5 (patch) | |
tree | a5107bcaa29a20941c8e971b1a0d81b68d4c82f3 /gdb/dwarf2read.c | |
parent | 24ba069af8a2078bc634bbf2599381fc0ea471ad (diff) | |
download | fsf-binutils-gdb-82bf32bc61ee1f2652fa848fe37b4e18429661c5.zip fsf-binutils-gdb-82bf32bc61ee1f2652fa848fe37b4e18429661c5.tar.gz fsf-binutils-gdb-82bf32bc61ee1f2652fa848fe37b4e18429661c5.tar.bz2 |
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.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index fc57db1..14d9a32 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -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) |