I am trying to parse the DWARF info and then using that information get the local variables from a program using a pin tool. It is kind of like using pin as GDB on steroids. However, I am having troubles understanding what they mean by the registers they have for the local variables and allocated ones.
For example,
<2>< 1214> DW_TAG_variable
DW_AT_name mts
DW_AT_decl_line 69
DW_AT_type <90>
DW_AT_location DW_OP_breg4+44
I understand that, in order to get the data from the variable mts, I have to add 44 to some register, my problem is that I don't exactly which register they are talking about. How should I interpret this? I couldn't find anything online.
Another examples are the DW_OP_fbreg, DW_OP_breg5 and so on.
Anyone knows which registers are they talking about in an x86 context? Are they talking about ebp or esp? Thanks.
It's a symbolic register name. See the xxx_map_dwarf_register methods in WineHQ's source for:
For example, DW_OP_breg4 is ESP on i386.
Also see the following if you haven't done so already.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With