[Dwarf-Discuss] Retrieving variables, function address using dwarf

Michael Eager eager@eagercon.com
Sat Mar 6 16:56:09 GMT 2021


On 3/5/21 8:28 PM, Archana Deshmukh via Dwarf-Discuss wrote:
> I need to read the address?of local?variable, global variable, function 
> name?and function?arguments from the process.
> 
> For global variables , I read the address "55b51afea000" from 
> /proc/<pid>/maps file. I use DW_OP_addr parameter to retrieve?the address.
> 55b51afea000?+?DW_OP_addr gives me the address of global variable.
> 
> I need to read the stack?segment, heap. Is there any way to read 
> segments? DW_AT_segment parameter seems to be for 16 bit.
> 
> I need to read the following process map using dwarf.
> 
> Any suggestion, pointers are welcome.
> 
> 55b51afea000-55b51afeb000 r-xp 00000000 fd:00 5902563

Can you explain what you are trying to do?

Usually a DWARF consumer (a debugger) does not need to read the
process memory map.  All of the information you mention is in
the DWARF data.  You may need to relocate addresses in the DWARF
debug data.

DWARF does not contain information about the process memory
layout, such as the location of the heap or the start of the
stack.

-- 
Michael Eager



More information about the Dwarf-discuss mailing list