From dead2f5e1dd8043d90206941fd52eef0402258ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Tue, 18 Mar 2008 18:43:11 +0000 Subject: [PATCH] Make -debug packages work as expected - introduce debug_files_suffix to store debug files like following caglar@zangetsu debug $ pwd /usr/lib/debug caglar@zangetsu debug $ find . ./usr ./usr/libexec ./usr/libexec/libvirt_proxy.debug ./usr/libexec/libvirt_parthelper.debug ./usr/lib ./usr/lib/python2.4 ./usr/lib/python2.4/site-packages ./usr/lib/python2.4/site-packages/libvirtmod.so.debug ./usr/lib/libvirt.so.0.4.1.debug ./usr/bin ./usr/bin/virsh.debug ./usr/sbin ./usr/sbin/libvirtd.debug - GDB will automatically uses .gnu_debuglink section for stripped binaries provided by PiSi caglar@zangetsu debug $ file /usr/bin/virsh /usr/bin/virsh: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.11, dynamically linked (uses shared libs), stripped [...] (gdb) run Starting program: /usr/bin/virsh [Thread debugging using libthread_db enabled] [New Thread -1213385040 (LWP 15967)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1213385040 (LWP 15967)] 0x0805727d in main (argc=1, argv=0xbfb003a4) at virsh.c:6539 6539 { (gdb) bt #0 0x0805727d in main (argc=1, argv=0xbfb003a4) at virsh.c:6539 #1 0xb7afce34 in __libc_start_main () from /lib/libc.so.6 #2 0x00000001 in ?? () #3 0xbfb003a4 in ?? () #4 0xbfb003ac in ?? () #5 0x0804a1be in ?? () #6 0xb7c05ff4 in ?? () from /lib/libc.so.6 #7 0x00000000 in ?? () (gdb) l 6534 return TRUE; 6535 } 6536 6537 int 6538 main(int argc, char **argv) 6539 { 6540 vshControl _ctl, *ctl = &_ctl; 6541 char *defaultConn; 6542 int ret = TRUE; 6543 char *message = NULL; [...] --- pisi/constants.py | 1 + pisi/util.py | 1 + 2 files changed, 2 insertions(+) diff --git a/pisi/constants.py b/pisi/constants.py index 11d03ffc..10d81652 100644 --- a/pisi/constants.py +++ b/pisi/constants.py @@ -62,6 +62,7 @@ class Constants: self.__c.work_dir_suffix = "/work" # these, too, because we might wanna change 'em self.__c.install_dir_suffix = "/install" self.__c.debug_dir_suffix = "/debug" + self.__c.debug_files_suffix = "/usr/lib/debug" self.__c.quilt_dir_suffix = "/patches" # file/directory names diff --git a/pisi/util.py b/pisi/util.py index c8346bab..f73c2e67 100644 --- a/pisi/util.py +++ b/pisi/util.py @@ -494,6 +494,7 @@ def strip_directory(top, excludelist=[]): frpath = join_path(root, fn) drpath = join_path(os.path.dirname(top), ctx.const.debug_dir_suffix, + ctx.const.debug_files_suffix, remove_prefix(top, frpath)) # Some upstream sources have buggy libtool and ltmain.sh with them,