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;
[...]
This commit is contained in:
S.Çağlar Onur
2008-03-18 18:43:11 +00:00
parent f7daaab828
commit dead2f5e1d
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -62,6 +62,7 @@ class Constants:
self.__c.work_dir_suffix = "/work" # these, too, because we might wanna change 'em self.__c.work_dir_suffix = "/work" # these, too, because we might wanna change 'em
self.__c.install_dir_suffix = "/install" self.__c.install_dir_suffix = "/install"
self.__c.debug_dir_suffix = "/debug" self.__c.debug_dir_suffix = "/debug"
self.__c.debug_files_suffix = "/usr/lib/debug"
self.__c.quilt_dir_suffix = "/patches" self.__c.quilt_dir_suffix = "/patches"
# file/directory names # file/directory names
+1
View File
@@ -494,6 +494,7 @@ def strip_directory(top, excludelist=[]):
frpath = join_path(root, fn) frpath = join_path(root, fn)
drpath = join_path(os.path.dirname(top), drpath = join_path(os.path.dirname(top),
ctx.const.debug_dir_suffix, ctx.const.debug_dir_suffix,
ctx.const.debug_files_suffix,
remove_prefix(top, frpath)) remove_prefix(top, frpath))
# Some upstream sources have buggy libtool and ltmain.sh with them, # Some upstream sources have buggy libtool and ltmain.sh with them,