mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-01-03 05:04:45 +01:00
Add and handle various dwarf5 addrx forms.
Given the almost nonexistent direct dwarfreader tests, I think the best way to test these dwarf5 additions will be to add a full dwarf5 compilation unit similar to the ones used incidentally in the other tests. But I can't do that until enough dwarf5 is correctly implemented. Change-Id: I3418bda7212ae85c4b67232a2ab8fea9b9ca5d42 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2258838 Reviewed-by: Mark Mentovai <mark@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
parent
feb2dca989
commit
72c118f4a6
6 changed files with 66 additions and 10 deletions
|
|
@ -182,17 +182,21 @@ const uint8_t *CompilationUnit::SkipAttribute(const uint8_t *start,
|
|||
|
||||
case DW_FORM_flag_present:
|
||||
return start;
|
||||
case DW_FORM_addrx1:
|
||||
case DW_FORM_data1:
|
||||
case DW_FORM_flag:
|
||||
case DW_FORM_ref1:
|
||||
case DW_FORM_strx1:
|
||||
return start + 1;
|
||||
case DW_FORM_addrx2:
|
||||
case DW_FORM_ref2:
|
||||
case DW_FORM_data2:
|
||||
case DW_FORM_strx2:
|
||||
return start + 2;
|
||||
case DW_FORM_addrx3:
|
||||
case DW_FORM_strx3:
|
||||
return start + 3;
|
||||
case DW_FORM_addrx4:
|
||||
case DW_FORM_ref4:
|
||||
case DW_FORM_data4:
|
||||
case DW_FORM_strx4:
|
||||
|
|
@ -208,6 +212,7 @@ const uint8_t *CompilationUnit::SkipAttribute(const uint8_t *start,
|
|||
case DW_FORM_strx:
|
||||
case DW_FORM_GNU_str_index:
|
||||
case DW_FORM_GNU_addr_index:
|
||||
case DW_FORM_addrx:
|
||||
reader_->ReadUnsignedLEB128(start, &len);
|
||||
return start + len;
|
||||
|
||||
|
|
@ -549,8 +554,7 @@ const uint8_t *CompilationUnit::ProcessAttribute(
|
|||
return start + 2;
|
||||
}
|
||||
case DW_FORM_strx3: {
|
||||
uint64_t str_index = reader_->ReadTwoBytes(start);
|
||||
str_index *= reader_->ReadOneByte(start + 2);
|
||||
uint64_t str_index = reader_->ReadThreeBytes(start);
|
||||
ProcessFormStringIndex(dieoffset, attr, form, str_index);
|
||||
return start + 3;
|
||||
}
|
||||
|
|
@ -560,14 +564,27 @@ const uint8_t *CompilationUnit::ProcessAttribute(
|
|||
return start + 4;
|
||||
}
|
||||
|
||||
case DW_FORM_GNU_addr_index: {
|
||||
uint64_t addr_index = reader_->ReadUnsignedLEB128(start, &len);
|
||||
const uint8_t* addr_ptr =
|
||||
addr_buffer_ + addr_base_ + addr_index * reader_->AddressSize();
|
||||
ProcessAttributeUnsigned(dieoffset, attr, form,
|
||||
reader_->ReadAddress(addr_ptr));
|
||||
case DW_FORM_addrx:
|
||||
case DW_FORM_GNU_addr_index:
|
||||
ProcessAttributeAddrIndex(
|
||||
dieoffset, attr, form, reader_->ReadUnsignedLEB128(start, &len));
|
||||
return start + len;
|
||||
}
|
||||
case DW_FORM_addrx1:
|
||||
ProcessAttributeAddrIndex(
|
||||
dieoffset, attr, form, reader_->ReadOneByte(start));
|
||||
return start + 1;
|
||||
case DW_FORM_addrx2:
|
||||
ProcessAttributeAddrIndex(
|
||||
dieoffset, attr, form, reader_->ReadTwoBytes(start));
|
||||
return start + 2;
|
||||
case DW_FORM_addrx3:
|
||||
ProcessAttributeAddrIndex(
|
||||
dieoffset, attr, form, reader_->ReadThreeBytes(start));
|
||||
return start + 3;
|
||||
case DW_FORM_addrx4:
|
||||
ProcessAttributeAddrIndex(
|
||||
dieoffset, attr, form, reader_->ReadFourBytes(start));
|
||||
return start + 4;
|
||||
}
|
||||
fprintf(stderr, "Unhandled form type\n");
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue