[Dwarf-Discuss] how to find all the compile unit using libdwarf

David Anderson davea42@earthlink.net
Tue Dec 4 15:55:36 GMT 2007


xu zhou wrote:
> Hello everyone,
>     I use libdwarf to build my own debugging program, here is my problem:
>     I use the function "dwarf_next_cu_header()" to search every
> compile unit of the Linux kernel(vmlinux). But I cannot get every
> compile unit corresponding to the source file. The number of compile
> units I get is much smaller than the actually number of source files.
> I don't know why. Does every source corresponds to a single compiled
> unit or they have other relationship?
>     I want to find the memory address of a line in source file. How can I do it?
>      Thank you!!!
>
>                   zhouxu
>   
It is quite possible that the compiler is simply not emitting
all the data you expect.  Or that the data is being stripped
from some object files or the executable.

Or that the kernel (as built) does not have some
sections related to duplicate-dwarf-emission removed (it should be
removed from any executable, but the kernel is not a normal executable,
so) ... does the linker remove such COMDAT-like sections?
libdwarf does not really deal with those yet.  Somebody give me some
objects with same, please?

Hard to say what is going on.
david anderson




More information about the Dwarf-discuss mailing list