libdwarf: Reading a location expression

libdwarf

Loading...
Searching...
No Matches
Reading a location expression

Example getting details of a location expression.

Example getting details of a location expression.

See also
  Location/expression access

*/
int example_locexprc(Dwarf_Debug dbg,Dwarf_Ptr expr_bytes,
Dwarf_Unsigned expr_len,
Dwarf_Half addr_size,
Dwarf_Half offset_size,
Dwarf_Half version,
Dwarf_Error*error)
{
Dwarf_Loc_Head_c head = 0;
Dwarf_Locdesc_c locentry = 0;
int res2 = 0;
Dwarf_Unsigned rawlopc = 0;
Dwarf_Unsigned rawhipc = 0;
Dwarf_Bool debug_addr_unavail = FALSE;
Dwarf_Unsigned lopc = 0;
Dwarf_Unsigned hipc = 0;
Dwarf_Unsigned ulistlen = 0;
Dwarf_Unsigned ulocentry_count = 0;
Dwarf_Unsigned section_offset = 0;
Dwarf_Unsigned locdesc_offset = 0;
Dwarf_Small lle_value = 0;
Dwarf_Small loclist_source = 0;
Dwarf_Unsigned i = 0;
res2 = dwarf_loclist_from_expr_c(dbg,
expr_bytes,expr_len,
addr_size,
offset_size,
version,
&head,
&ulistlen,
error);
if (res2 != DW_DLV_OK) {
return res2;
}
/* These are a location expression, not loclist.
So we just need the 0th entry.
Dwarf_Loc_Head_c
struct Dwarf_Loc_Head_c_s * Dwarf_Loc_Head_c
Definition libdwarf.h:347
Dwarf_Error
struct Dwarf_Error_s * Dwarf_Error
Definition libdwarf.h:611
Dwarf_Locdesc_c
struct Dwarf_Locdesc_c_s * Dwarf_Locdesc_c
Definition libdwarf.h:342
Dwarf_Debug
struct Dwarf_Debug_s * Dwarf_Debug
Definition libdwarf.h:617
Dwarf_Bool
int Dwarf_Bool
Definition libdwarf.h:202
Dwarf_Ptr
void * Dwarf_Ptr
Definition libdwarf.h:208
Dwarf_Half
unsigned short Dwarf_Half
Definition libdwarf.h:203
Dwarf_Small
unsigned char Dwarf_Small
Definition libdwarf.h:204
Dwarf_Unsigned
unsigned long long Dwarf_Unsigned
Definition libdwarf.h:196
dwarf_loclist_from_expr_c
DW_API int dwarf_loclist_from_expr_c(Dwarf_Debug dw_dbg, Dwarf_Ptr dw_expression_in, Dwarf_Unsigned dw_expression_length, Dwarf_Half dw_address_size, Dwarf_Half dw_offset_size, Dwarf_Half dw_dwarf_version, Dwarf_Loc_Head_c *dw_loc_head, Dwarf_Unsigned *dw_listlen, Dwarf_Error *dw_error)
Generate a Dwarf_Loc_Head_c from an expression block.