Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Compile gdb with libc debug symbols
@ 2010-02-02 20:16 Vlad Ureche
  2010-02-02 20:33 ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Vlad Ureche @ 2010-02-02 20:16 UTC (permalink / raw)
  To: gdb

[-- Attachment #1: Type: text/plain, Size: 798 bytes --]

Hello,


I have a newbie question, I googled it but haven't found the answer.
I'm compiling gdb 7.0.1 on a Ubuntu 9.10 machine with libc6-dbg
package installed. The resulting binary does not see the libc debug
symbols, even though the binary packaged with ubuntu does so. I'm
using the following configure parameters:

./configure --build='x86_64-linux-gnu' --prefix="/home/sun/esd-work/dist/gdb"

Can you please indicate how to add the libc debug symbols support? The
libc with debug symbols is located in
/usr/lib/debug/lib/libc-2.10.1.so. I have attached an example run for
a double-free crash: notice the ubuntu packaged gdb indicates the
source file, line and parameters for each frame in the backtrace while
the compiled version only shows "from /lib/libc.so.6".

Thank you.

-- 
Vlad Ureche

[-- Attachment #2: gdb-run.txt --]
[-- Type: text/plain, Size: 3692 bytes --]

-- gdb packaged with ubuntu --
sun@dslabpc17:~/esd-work/src/test$ gdb ./a.out ./core
GNU gdb (GDB) 7.0-ubuntu
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/sun/esd-work/src/test/a.out...done.

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib/libc.so.6...Reading symbols from /usr/lib/debug/lib/libc-2.10.1.so...done.
(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...Reading symbols from /usr/lib/debug/lib/ld-2.10.1.so...done.
(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib/libgcc_s.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libgcc_s.so.1
Core was generated by `./a.out'.
Program terminated with signal 6, Aborted.
#0  0x00007fd0b95cb4b5 in *__GI_raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64	../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
	in ../nptl/sysdeps/unix/sysv/linux/raise.c
(gdb) bt
#0  0x00007fd0b95cb4b5 in *__GI_raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007fd0b95cef50 in *__GI_abort () at abort.c:92
#2  0x00007fd0b9603c97 in __libc_message (do_abort=<value optimized out>, fmt=<value optimized out>) at ../sysdeps/unix/sysv/linux/libc_fatal.c:189
#3  0x00007fd0b960ddd6 in malloc_printerr (action=3, str=0x7fd0b96cf748 "double free or corruption (fasttop)", ptr=<value optimized out>) at malloc.c:6217
#4  0x00007fd0b961274c in *__GI___libc_free (mem=<value optimized out>) at malloc.c:3716
#5  0x000000000040057c in dofree (temp=0x763010 "") at a.c:4
#6  0x00000000004005ac in main () at a.c:10

-- compiled gdb --
sun@dslabpc17:~/esd-work/src/test$ ~/esd-work/dist/gdb/bin/gdb ./a.out ./core
GNU gdb (GDB) 7.0.1
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/sun/esd-work/src/test/a.out...done.

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib/libgcc_s.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libgcc_s.so.1
Core was generated by `./a.out'.
Program terminated with signal 6, Aborted.
#0  0x00007fd0b95cb4b5 in raise () from /lib/libc.so.6
(gdb) bt
#0  0x00007fd0b95cb4b5 in raise () from /lib/libc.so.6
#1  0x00007fd0b95cef50 in abort () from /lib/libc.so.6
#2  0x00007fd0b9603c97 in ?? () from /lib/libc.so.6
#3  0x00007fd0b960ddd6 in ?? () from /lib/libc.so.6
#4  0x00007fd0b961274c in free () from /lib/libc.so.6
#5  0x000000000040057c in dofree (temp=0x763010 "") at a.c:4
#6  0x00000000004005ac in main () at a.c:10


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Compile gdb with libc debug symbols
  2010-02-02 20:16 Compile gdb with libc debug symbols Vlad Ureche
@ 2010-02-02 20:33 ` Daniel Jacobowitz
  2010-02-02 20:40   ` Vlad Ureche
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2010-02-02 20:33 UTC (permalink / raw)
  To: Vlad Ureche; +Cc: gdb

On Tue, Feb 02, 2010 at 09:15:42PM +0100, Vlad Ureche wrote:
> Hello,
> 
> 
> I have a newbie question, I googled it but haven't found the answer.
> I'm compiling gdb 7.0.1 on a Ubuntu 9.10 machine with libc6-dbg
> package installed. The resulting binary does not see the libc debug
> symbols, even though the binary packaged with ubuntu does so. I'm
> using the following configure parameters:
> 
> ./configure --build='x86_64-linux-gnu' --prefix="/home/sun/esd-work/dist/gdb"

Try --with-separate-debug-dir=/usr/lib/debug.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Compile gdb with libc debug symbols
  2010-02-02 20:33 ` Daniel Jacobowitz
@ 2010-02-02 20:40   ` Vlad Ureche
  0 siblings, 0 replies; 3+ messages in thread
From: Vlad Ureche @ 2010-02-02 20:40 UTC (permalink / raw)
  To: Vlad Ureche, gdb

On Tue, Feb 2, 2010 at 9:32 PM, Daniel Jacobowitz <dan@codesourcery.com> wrote:
> On Tue, Feb 02, 2010 at 09:15:42PM +0100, Vlad Ureche wrote:
>>
>> I have a newbie question, I googled it but haven't found the answer.
>> I'm compiling gdb 7.0.1 on a Ubuntu 9.10 machine with libc6-dbg
>> package installed. The resulting binary does not see the libc debug
>> symbols, even though the binary packaged with ubuntu does so. I'm
>> using the following configure parameters:
>>
>> ./configure --build='x86_64-linux-gnu' --prefix="/home/sun/esd-work/dist/gdb"
>
> Try --with-separate-debug-dir=/usr/lib/debug.
>

It worked! Thanks a lot!

-- 
Vlad Ureche


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-02 20:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-02 20:16 Compile gdb with libc debug symbols Vlad Ureche
2010-02-02 20:33 ` Daniel Jacobowitz
2010-02-02 20:40   ` Vlad Ureche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox