summaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2013-09-24 14:03:43 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2013-09-24 14:03:43 +0000
commitc6c2f71764cc17ec2a855b21f454449d4118720a (patch)
tree1c1caaec3e269f3c36af81f698aa42b13cc35e6f /gdb/dwarf2read.c
parent21c745fd835a2b42a60ac0612f070a64655a3cd5 (diff)
downloadgdb-c6c2f71764cc17ec2a855b21f454449d4118720a.tar.gz
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.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index fc57db16ddc..14d9a32a007 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)