[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libunwind-devel] [PATCH 2/6] Fix .gnu_debuglink lookup for separate deb
From: |
anderson . lizardo |
Subject: |
[Libunwind-devel] [PATCH 2/6] Fix .gnu_debuglink lookup for separate debug symbols |
Date: |
Thu, 17 Jul 2008 10:23:24 -0300 |
User-agent: |
quilt/0.46-1 |
Current implementation fails to find separate debug symbols when .gnu_debuglink
is set to the same name of the target ELF basename (e.g. "libc.so.6" for
/lib/libc.so.6). This patch fixes this by ignoring separate debug files that
contain a .gnu_debuglink section.
It also fixes a small typo in a related Debug() line.
Signed-off-by: Anderson Lizardo <address@hidden>
Signed-off-by: Bruna Moreira <address@hidden>
---
src/dwarf/Gfind_proc_info-lsb.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
Index: libunwind-indt-split-v2/src/dwarf/Gfind_proc_info-lsb.c
===================================================================
--- libunwind-indt-split-v2.orig/src/dwarf/Gfind_proc_info-lsb.c
+++ libunwind-indt-split-v2/src/dwarf/Gfind_proc_info-lsb.c
@@ -153,7 +153,7 @@
Debug (4, "read %d bytes of .debug_frame from offset %d\n",
*bufsize, sec_hdrs[i].sh_offset);
}
- else if (is_local >= 0 && strcmp (secname, ".gnu_debuglink") == 0)
+ else if (strcmp (secname, ".gnu_debuglink") == 0)
{
linksize = sec_hdrs[i].sh_size;
linkbuf = malloc (linksize);
@@ -162,7 +162,7 @@
fread (linkbuf, 1, linksize, f);
Debug (4, "read %d bytes of .gnu_debuglink from offset %d\n",
- *bufsize, sec_hdrs[i].sh_offset);
+ linksize, sec_hdrs[i].sh_offset);
}
}
@@ -171,6 +171,13 @@
fclose (f);
+ /* Ignore separate debug files which contain a .gnu_debuglink section. */
+ if (linkbuf && is_local == -1)
+ {
+ free (linkbuf);
+ return 1;
+ }
+
if (*buf == NULL && linkbuf != NULL && memchr (linkbuf, 0, linksize) != NULL)
{
char *newname, *basedir, *p;
--
Anderson Lizardo
Instituto Nokia de Tecnologia (INdT)
Manaus - Brazil
- [Libunwind-devel] [PATCH 0/6] Add .debug_frame based remote backtrace support (v2), anderson . lizardo, 2008/07/17
- [Libunwind-devel] [PATCH 5/6] Factor out and export dwarf_find_debug_frame() function, anderson . lizardo, 2008/07/17
- [Libunwind-devel] [PATCH 6/6] Add .debug_frame based remote unwinding support, anderson . lizardo, 2008/07/17
- [Libunwind-devel] [PATCH 1/6] ARM: add missing register offsets, anderson . lizardo, 2008/07/17
- [Libunwind-devel] [PATCH 2/6] Fix .gnu_debuglink lookup for separate debug symbols,
anderson . lizardo <=
- [Libunwind-devel] [PATCH 4/6] Add ip argument to _UPTi_find_unwind_table, anderson . lizardo, 2008/07/17
- [Libunwind-devel] [PATCH 3/6] Add path and pathlen arguments to tdep_get_elf_image(), anderson . lizardo, 2008/07/17