int dwarf_loclist_from_expr_a(Dwarf_Debug dbg, Dwarf_Ptr bytes_in, Dwarf_Unsigned bytes_len, Dwarf_Half addr_size, Dwarf_Locdesc **llbuf, Dwarf_Signed *listlen, Dwarf_Error *error) { Dwarf_Locdesc *ld; int ret; if (dbg == NULL || bytes_in == NULL || bytes_len == 0 || llbuf == NULL || listlen == NULL) { DWARF_SET_ERROR(dbg, error, DW_DLE_ARGUMENT); return (DW_DLV_ERROR); } if (addr_size != 4 && addr_size != 8) { DWARF_SET_ERROR(dbg, error, DW_DLE_ARGUMENT); return (DW_DLV_ERROR); } ret = _dwarf_loc_fill_locexpr(dbg, &ld, bytes_in, bytes_len, addr_size, error); if (ret != DW_DLE_NONE) return (DW_DLV_ERROR); *llbuf = ld; *listlen = 1; return (DW_DLV_OK); }
int _dwarf_loc_add(Dwarf_Die die, Dwarf_Attribute at, Dwarf_Error *error) { Dwarf_Debug dbg; Dwarf_CU cu; int ret; assert(at->at_ld == NULL); assert(at->u[1].u8p != NULL); assert(at->u[0].u64 > 0); cu = die->die_cu; assert(cu != NULL); dbg = cu->cu_dbg; assert(dbg != NULL); ret = _dwarf_loc_fill_locexpr(dbg, &at->at_ld, at->u[1].u8p, at->u[0].u64, cu->cu_pointer_size, error); return (ret); }