Debugger: implement parsing for v4 line-info
Differences between DWARF v3/v4 for line-info:
- added new field maxOpsPerInstruction
this new field will typically have the value of 1
unless VLIW architecture is being used
(which is not the case for Haiku)
- state machine contains a new field op_index
it has any relevance only when maxOpsPerInstruction > 1
i.e. on VLIW architectures
- added new operation DW_LNE_set_discriminator
this is already implemented in LineNumberProgram.cpp
This implementation just reads maxOpsPerInstruction and
checks that it is set to 1, which is what we expect on
all architectures currently supported by Haiku.
Change-Id: I14755d615a0e2b3a5177928c4d8f9014940a5fcf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6876
Reviewed-by: Rene Gollent <rene@gollent.com>
(cherry picked from commit 3f2464f759bbb21f49e8abf5bad429ba7d344952)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7017
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Diff
src/kits/debugger/dwarf/DwarfFile.cpp | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
@@ -1779,7 +1779,7 @@
uint16 version = dataReader.Read<uint16>(0);
if (version != 2 && version != 3) {
if (version < 2 || version > 4) {
WARNING("DwarfFile::_ParseLineInfo(\"%s\"): unsupported "
"version %d\n", fName, version);
return B_UNSUPPORTED;
@@ -1796,6 +1796,18 @@
uint8 minInstructionLength = dataReader.Read<uint8>(0);
uint8 maxOpsPerInstruction;
if (version >= 4)
maxOpsPerInstruction = dataReader.Read<uint8>(0);
else
maxOpsPerInstruction = 1;
if (maxOpsPerInstruction != 1) {
WARNING("DwarfFile::_ParseLineInfo(\"%s\"): unsupported "
"maxOpsPerInstruction %u\n", fName, maxOpsPerInstruction);
return B_UNSUPPORTED;
}
bool defaultIsStatement = dataReader.Read<uint8>(0) != 0;
@@ -1819,6 +1831,8 @@
TRACE_LINES(" version: %u\n", version);
TRACE_LINES(" headerLength: %" B_PRIu64 "\n", headerLength);
TRACE_LINES(" minInstructionLength: %u\n", minInstructionLength);
if (version >= 4)
TRACE_LINES(" maxOpsPerInstruction: %u\n", maxOpsPerInstruction);
TRACE_LINES(" defaultIsStatement: %d\n", defaultIsStatement);
TRACE_LINES(" lineBase: %d\n", lineBase);
TRACE_LINES(" lineRange: %u\n", lineRange);