Hello,

On sekmadienis 31 Liepa 2011 14:05:47 Jerome Vizcaino wrote:
> Ok I see. I thought the /usr/lib/debug where identical libraries with debug
> symbols and we needed to link against those. My mistake, I will close the
> bug if I can.

I have closed it already.

> This is bit off topic but what if I want to print backtrace from my
> application then ? (in case of segfault or something) I guess I would have
> to load debug symbols with the same mechanism gdb uses ?

Yes. Though I would expect there to be a standard interface to do this since 
files with only debug symbols are no Debian invention. I'm no expert but e.g.

$ objdump -T /usr/lib/libQtCore.so.4.7.3 | grep _ZN7QString6expandEi | awk 
'{print $1}' | strace -e trace=open -- addr2line -f -p -i -e 
/usr/lib/libQtCore.so.4.7.3
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/usr/lib/libbfd-2.21.53-system.20110729.so", O_RDONLY) = 3
open("/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY) = 3
open("/usr/lib/libz.so.1", O_RDONLY)    = 3
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY) = 3
open("/usr/lib/libQtCore.so.4.7.3", O_RDONLY) = 3
open("/usr/lib/libQtCore.so.4.7.3", O_RDONLY) = 4
open("/usr/lib/.debug/libQtCore.so.4.7.3", O_RDONLY) = -1 ENOENT (No such file 
or directory)
open("/usr/lib/debug/usr/lib/libQtCore.so.4.7.3", O_RDONLY) = 4
open("/usr/lib/debug/usr/lib/libQtCore.so.4.7.3", O_RDONLY) = 4
_ZN7QString6expandEi at /build/qt4-x11-M9gkNk/qt4-
x11-4.7.3/src/corelib/tools/qstring.cpp:1331

does the job well. See above how addr2line opens /usr/lib/debug automagically.

-- 
Modestas Vainius <mo...@debian.org>

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to