"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. 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. Ian