dbghelp/dwarf: Add support for FORM_loc_offset and FORM_sec_offset.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2021-09-11 10:59:05 +02:00 committed by Alexandre Julliard
parent 8241fe3877
commit 6bd22a2f50
1 changed files with 14 additions and 2 deletions

View File

@ -489,7 +489,6 @@ static void dwarf2_swallow_attribute(dwarf2_traverse_context_t* ctx,
case DW_FORM_ref2: step = 2; break; case DW_FORM_ref2: step = 2; break;
case DW_FORM_data4: case DW_FORM_data4:
case DW_FORM_ref4: step = 4; break; case DW_FORM_ref4: step = 4; break;
case DW_FORM_strp: step = head->offset_size; break;
case DW_FORM_data8: case DW_FORM_data8:
case DW_FORM_ref8: step = 8; break; case DW_FORM_ref8: step = 8; break;
case DW_FORM_sdata: case DW_FORM_sdata:
@ -500,6 +499,8 @@ static void dwarf2_swallow_attribute(dwarf2_traverse_context_t* ctx,
case DW_FORM_block1: step = dwarf2_parse_byte(ctx); break; case DW_FORM_block1: step = dwarf2_parse_byte(ctx); break;
case DW_FORM_block2: step = dwarf2_parse_u2(ctx); break; case DW_FORM_block2: step = dwarf2_parse_u2(ctx); break;
case DW_FORM_block4: step = dwarf2_parse_u4(ctx); break; case DW_FORM_block4: step = dwarf2_parse_u4(ctx); break;
case DW_FORM_sec_offset:
case DW_FORM_strp: step = head->offset_size; break;
default: default:
FIXME("Unhandled attribute form %lx\n", abbrev_attr->form); FIXME("Unhandled attribute form %lx\n", abbrev_attr->form);
return; return;
@ -625,6 +626,11 @@ static void dwarf2_fill_attr(const dwarf2_parse_context_t* ctx,
TRACE("block<%p,%u>\n", attr->u.block.ptr, attr->u.block.size); TRACE("block<%p,%u>\n", attr->u.block.ptr, attr->u.block.size);
break; break;
case DW_FORM_sec_offset:
attr->u.lluvalue = dwarf2_get_addr(data, ctx->head.offset_size);
TRACE("sec_offset<%s>\n", wine_dbgstr_longlong(attr->u.lluvalue));
break;
default: default:
FIXME("Unhandled attribute form %lx\n", abbrev_attr->form); FIXME("Unhandled attribute form %lx\n", abbrev_attr->form);
break; break;
@ -935,11 +941,16 @@ static BOOL dwarf2_compute_location_attr(dwarf2_parse_context_t* ctx,
loc->reg = 0; loc->reg = 0;
loc->offset = xloc.u.uvalue; loc->offset = xloc.u.uvalue;
return TRUE; return TRUE;
case DW_FORM_data4: case DW_FORM_data8: case DW_FORM_data4:
loc->kind = loc_dwarf2_location_list; loc->kind = loc_dwarf2_location_list;
loc->reg = Wine_DW_no_register; loc->reg = Wine_DW_no_register;
loc->offset = xloc.u.uvalue; loc->offset = xloc.u.uvalue;
return TRUE; return TRUE;
case DW_FORM_data8: case DW_FORM_sec_offset:
loc->kind = loc_dwarf2_location_list;
loc->reg = Wine_DW_no_register;
loc->offset = xloc.u.lluvalue;
return TRUE;
case DW_FORM_block: case DW_FORM_block:
case DW_FORM_block1: case DW_FORM_block1:
case DW_FORM_block2: case DW_FORM_block2:
@ -1662,6 +1673,7 @@ static void dwarf2_parse_variable(dwarf2_subprogram_t* subpgm,
break; break;
case DW_FORM_data8: case DW_FORM_data8:
case DW_FORM_sec_offset:
v.n1.n2.vt = VT_UI8; v.n1.n2.vt = VT_UI8;
v.n1.n2.n3.llVal = value.u.lluvalue; v.n1.n2.n3.llVal = value.u.lluvalue;
break; break;