libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libunwind-devel] [PATCH 2/7] Change debuglink lookup order


From: Anderson Lizardo
Subject: [Libunwind-devel] [PATCH 2/7] Change debuglink lookup order
Date: Wed, 25 Jun 2008 07:51:09 -0400
User-agent: quilt/0.46-1

Current lookup order for e.g. /lib/libc.so.6 is:

1) /lib/libc.so.6
2) /lib/.debug/libc.so.6
3) /usr/lib/debug/lib/libc.so.6

That does not work, because it will first read /lib/libc.so.6, see the
debuglink pointing to "libc.so.6" and again try to lookup /lib/libc.so.6. This
patch changes that order to: 

1) /usr/lib/debug/lib/libc.so.6
2) /lib/.debug/libc.so.6
3) /lib/libc.so.6

Signed-off-by: Anderson Lizardo <address@hidden>
Signed-off-by: Bruna Moreira <address@hidden>
---
 src/dwarf/Gfind_proc_info-lsb.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Index: libunwind-indt-split/src/dwarf/Gfind_proc_info-lsb.c
===================================================================
--- libunwind-indt-split.orig/src/dwarf/Gfind_proc_info-lsb.c
+++ libunwind-indt-split/src/dwarf/Gfind_proc_info-lsb.c
@@ -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);
        }
     }
 
@@ -191,7 +191,8 @@
       else
        basedir[0] = 0;
 
-      strcpy (newname, basedir);
+      strcpy (newname, debugdir);
+      strcat (newname, basedir);
       strcat (newname, "/");
       strcat (newname, linkbuf);
       ret = load_debug_frame (newname, buf, bufsize, -1);
@@ -206,8 +207,7 @@
 
       if (ret == 1 && is_local == 1)
        {
-         strcpy (newname, debugdir);
-         strcat (newname, basedir);
+         strcpy (newname, basedir);
          strcat (newname, "/");
          strcat (newname, linkbuf);
          ret = load_debug_frame (newname, buf, bufsize, -1);

-- 
Anderson Lizardo
Instituto Nokia de Tecnologia (INdT)
Manaus - Brazil




reply via email to

[Prev in Thread] Current Thread [Next in Thread]