Please see my comments embedded with "BVI>" -----Original Message----- From: Ian Lance Taylor [mailto:i...@google.com] Sent: Thursday, October 20, 2011 2:18 PM To: Iyer, Balaji V Cc: 'gcc@gcc.gnu.org' Subject: Re: Getting DWARF codes from RTX
"Iyer, Balaji V" <balaji.v.i...@intel.com> writes: > What I want to do is to look at certain function calls and mark them > with a special label and then create a table with a specialized > section with contains the label name, the function name (as ascii > string) and then the dwarf code of the register (assuming the > parameters can be passed in through registers, otherwise the stack > address location) in which the parameters for the function is stored. > (Please note that this is something that is customized for another > package and I don't have much leeway on how to store this information) > > Eg. > > If you have: > some_func_call (x, y, z) > > We will have an assembly like this > > Set R1, x > Set R2, y > Set R3, z > LABEL_X: <=== SOMETHING I PUT IN > Call some_func_call > > > In my data section I would have something like this: > > LABEL_X > some_func_call > DW_OP_REG1, DW_OP_REG2, DW_OP_REG3 OK, I think I mostly understand all that. > So, I need the equivalent dwarf code (in hex) for DW_OP_REG1, DW_OP_REG2 and > DW_OP_REG3, so that a dwarf decoder can decode it correctly. I'm not sure I understand that. The code for DW_OP_reg1 is 0x51, as you can see in include/dwarf2.h. But I don't think that is what you mean. BVI> Actually what I want is to have a way to go from the rtx value e.g (REG: SI 1 di) to 0x51 It sounds like you might be asking for a way to get the DWARF representation of the argument locations of the function call. See loc_descriptor in gcc/dwarf2out.c. BVI> I will look into the loc descriptor. Thank you! Ian Thanks, Balaji V. Iyer.