how to install debug info for libc?

2.9k Views Asked by At

ADD : This link (https://stackoverflow.com/a/48287761/2554472) had the answer for my question (Mark Plotnick's answer). Different title, duplicate answer.

I'm using ddd(with gdb) to analyze a program(qemu).
Before the main() starts, there are some codes running using functions in glibc.
For example I want to see what libc_csu_init is doing(initializing static variables maybe..).
But since my qemu program is linked to release version of libc, I can't see the libc code.
How can I install debug info for libc and see the source code during debug? Do I have to install the debug version libc and compile qemu using that? or can I just install the debug version libc and see the libc source while running dbg?
By the way, if I do ldd qemu-system-aarch64, I can see a line below.

libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2feafb3000)

this means it was compiled against glibc because the libc is under x86_64-linux-gnu directory, isn't it? Please correct me if I'm wrong.

0

There are 0 best solutions below