[Dwarf-discuss] Question about differentiate instruction address in different sections
Wed Apr 12 18:04:07 GMT 2006
I'm a new learner of dwarf. In my current project, I'm trying to use dwarf
to link the instructions in a relocate binary to the corresponding source
code line number.
And I choose to use libdwarf to do that.
For simple program, my analysis works fine. However, I met a problem
when I worked on a relocate binary with debug information on multiple code
I can not distinguish at which section an instruction locates by looking at
provided by libdwarf.
For example, using dwarfdump -l (dwarfdump came with libdwarf), part of the
output of vmlinux
relocate binary looks as:
linux-compact/mm/shmem.c: [1670,-1] 0x6df6 // new statement // end of
linux-compact/mm/shmem.c: [ 79,-1] 0x26190 // new statement
linux-compact/mm/shmem.c: [ 79,-1] 0x26193 // new statement
The first column and second column are the file name and line no of source
third column is the pc (or address of instruction). In the first entry, the
with address 0x6df6 is in .text.init section and the instructions in the
next two entries
are in .text section. However, the output does not tell me in which section
are. The addresses listed there are actually the offset to the beginning of
the code section,
where the instructions locate. I can not find a way to differentiate whether
an instruction is in .text or .text.init by looking at the address. Anybody
can help me out?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Dwarf-discuss