Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 31eec5f

Browse files
Support for strx3, which requires a 3-byte read (a first)
1 parent 0d34c6e commit 31eec5f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/dwarf.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,7 @@ struct dwarf::implementation {
708708

709709
std::uint64_t read64();
710710
std::uint32_t read32();
711+
std::uint32_t read24();
711712
std::uint32_t read16();
712713
std::uint32_t read8();
713714
std::uint32_t read_uleb();
@@ -778,6 +779,15 @@ std::uint64_t dwarf::implementation::read64() { return read<std::uint64_t>(); }
778779

779780
std::uint32_t dwarf::implementation::read32() { return read<std::uint32_t>(); }
780781

782+
std::uint32_t dwarf::implementation::read24() {
783+
std::uint32_t result{0};
784+
_s.read(reinterpret_cast<char*>(&result), 3);
785+
if (_details._needs_byteswap) {
786+
endian_swap(result);
787+
}
788+
return result;
789+
}
790+
781791
std::uint32_t dwarf::implementation::read16() { return read<std::uint16_t>(); }
782792

783793
std::uint32_t dwarf::implementation::read8() { return read<std::uint8_t>(); }
@@ -1732,6 +1742,11 @@ attribute_value dwarf::implementation::process_form(const attribute& attr,
17321742
// SPECREF: DWARF5 page 236 (218) line 31
17331743
result.string(read_debug_str_offs(read16()));
17341744
} break;
1745+
case dw::form::strx3: {
1746+
// First seen in Xcode 16.1 w/ DWARF5.
1747+
// SPECREF: DWARF5 page 236 (218) line 31
1748+
result.string(read_debug_str_offs(read24()));
1749+
} break;
17351750
case dw::form::strx4: {
17361751
// First seen in Xcode 16.1 w/ DWARF5.
17371752
// SPECREF: DWARF5 page 236 (218) line 31

0 commit comments

Comments
 (0)