2

I'm looking to debug the malloc and free routines used by libc. In order to do that I installed the following packages.

sudo apt-get install libc6-dbg
sudo apt-get install libc6:i386
sudo apt-get install libc6-dbg:i386

I'm on a 64-bit Ubuntu 15.04 machine and I'm debugging a i386 binary. I see the post here that seems to deal with a similar problem.

Inside gdb I check the location from which debug files are loaded and get this.

(gdb) show debug-file-directory
The directory where separate debug symbols are searched for is "/usr/lib/debug".

However, there is no indication that the debug symbols are being loaded. How could I fix this?

[EDIT] I've tried this with both amd64 and i386 binaries and the results are the same. The binaries I'm debugging themselves do not have debugging symbols installed in them.

1 Answers1

0

However, there is no indication ...

What indication are you looking for?

I am guessing that you did something like:

gdb ./a.out
(gdb) list malloc  # complains about "no symbols loaded"

Do this instead:

gdb ./a.out
(gdb) start
# breakpoint 1 hit
(gdb) list __libc_malloc

Explanation: libc.so.6 and its debug symbols are not loaded (and therefore not visible) until the program actually starts.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362