XLATE_PRO_ADD_REG_INFO(3E) XLATE_PRO_ADD_REG_INFO(3E)
xlate_pro_add_reg_info - add register change information
#include <elf.h>
#include <libelf.h>
#include <dwarf.h>
#include <libdwarf.h>
#include <cmplrs/xlate.h>
#include <libXlate.h>
int xlate_pro_add_reg_info(xlate_table_pro pro_table_ptr,
Dwarf_Small op,
Dwarf_Unsigned val1,
Dwarf_Unsigned val2
);
xlate_pro_add_reg_info is used to put register information into the xlate
data stream. The register information normally specifies how a debugger
or other tool can get to registers which have been copied into shadow
register locations so a transforming tool (pixie(1) normally) can use the
registers for its own purposes. pro_table_ptr must be a valid open
producer translate table handle.
op Pass in an frame operation code in the set allowed. An example
is DW_CFA_offset_extended. Makes no difference if the op is an
extended op code or not (see section 6.4 of the DWARF document).
The arguments val1 and val2 are the "arguments" as described by
section 6.4.2 of the DWARF document.
val1 Is a value whose meaning depends on op . (see section 6.4 of the
DWARF document).
val2 Is a value whose meaning depends on op . (see section 6.4 of the
DWARF document).
A typical use for pixie would be to first set the CFA using
DW_CFA_offset_extended and naming the register or location to use as a
base address and then set up a rule for each particular register using,
for example, DW_CFA_offset orDW_CFA_offset_extended and giving the
particular offset of the shadow register value.
An example follows:
Page 1
XLATE_PRO_ADD_REG_INFO(3E) XLATE_PRO_ADD_REG_INFO(3E)
result = xlate_pro_add_reg_info(pro_table_ptr,
DW_CFA_def_cfa,
DW_FRAME_REG8, /* r8 is our base reg */
0);
result = xlate_pro_add_reg_info(pro_table_ptr,
DW_CFA_offset_extended,
DW_FRAME_REG31, /* r31 usurped by pixie */
r31_offset);
result = xlate_pro_add_reg_info(pro_table_ptr,
DW_CFA_offset_extended,
DW_FRAME_REG17, /* r17 usurped by pixie */
r17_offset);
/usr/include/libXlate.h
/usr/include/cmplrs/xlate.h
/usr/include/elf.h
/usr/include/dwarf.h
/usr/include/libdwarf.h
/usr/lib/libelfutil.a
Returns XLATE_TB_STATUS_NO_ERROR (0) on success. In case of error, a
negative number is returned indicating the error. In case of error,
nothing is returned thru the pointer arguments which would return values
on successful call (values might have been changed thru these pointers
but any such changes are not meaningful).
Error codes that may be returned:
XLATE_TB_STATUS_INVALID_TABLE
means that the pro_table_ptr is not a valid open producer handle.
Or it might mean there has been some malloc arena corruption or
other application bug leading to overwriting of the first 4 bytes
of the data pointed at by pro_table_ptr.
XLATE_TB_STATUS_ADD_TOO_LATE
means that the call has occurred after a call to
xlate_pro_disk_header which is not allowed. call
xlate_pro_add_reg_info before calling xlate_pro_disk_header.
XLATE_TB_STATUS_BAD_REG_VAL
means that the register number passed in will not fit using the
particular op used in the call.
XLATE_TB_STATUS_ALLOC_FAIL
means realloc(3) failed when adding the requested register
operation.
XLATE_TB_STATUS_BAD_REG_OP
means the op passed in is not one of the set of frame operations
supported by xlate_pro_add_reg_info.
Page 2
XLATE_PRO_ADD_REG_INFO(3E) XLATE_PRO_ADD_REG_INFO(3E)
libelfutil(5), xlate(4), xlate_pro_init(3e), xlate_pro_finish(3e) DWARF
Debugging Information Format (Version 2)
PPPPaaaaggggeeee 3333 [ Back ]
|