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

Re: How to use -dbg packages (and specifically libncurses5-dbg) ?



Le 15/09/2010 13:55, Sven Joachim a écrit :
> On 2010-09-15 12:23 +0200, Frédéric Boiteux wrote:
>
>   
>>   I'm trying to debug an own C program which dumps a core, inside libncurses5 library.
>> I'd like to use gdb to debug my program, and so I've installed -dbg packages :
>> libc6-dbg, libncurses5-dbg, libstdc++-6.4.3-dbg (on a Debian Lenny system), but if the libc6's
>> debug package is used by gdb, the libncurses5-dbg seems to be skipped :
>> [...]
>>
>> Does I have to redo the compilation before to test my program with libncurses5-dbg debug library ?
>>     
> No, but you have to set LD_LIBRARY_PATH=/usr/lib/debug so that the
> debug version of libncurses5 is picked up.
>
>   
Hello Sven,

I've tried :

env LD_LIBRARY_PATH=/usr/lib/debug gdb ecran core.ecran
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib/libncurses.so.5...done.
Loaded symbols for /lib/libncurses.so.5
Reading symbols from /usr/lib/libstdc++.so.6...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/libm.so.6...Reading symbols from
/usr/lib/debug/lib/libm-2.7.so...done.
done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libgcc_s.so.1...Reading symbols from
/usr/lib/debug/lib/libgcc_s.so.1...done.
done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/libc.so.6...Reading symbols from
/usr/lib/debug/lib/libc-2.7.so...done.
done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/libdl.so.2...Reading symbols from
/usr/lib/debug/lib/libdl-2.7.so...done.
done.
…
Core was generated by `ecran -m 8192'.
Program terminated with signal 11, Segmentation fault.
[New process 3025]
#0 0xb7711975 in _nc_freewin () from /lib/libncurses.so.5
(gdb)

And I don't have access to debug symbols .

Do I have to use the LD_LIBRARY_PATH during my program's linking process
(with ld), or do I have to use it with gdb ?

regards,
Fred.


Reply to: