Index: source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h =================================================================== --- source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h +++ source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h @@ -75,6 +75,7 @@ uint16_t version; // Version identifier for the statement information format. uint32_t prologue_length;// The number of bytes following the prologue_length field to the beginning of the first byte of the statement program itself. uint8_t min_inst_length;// The size in bytes of the smallest target machine instruction. Statement program opcodes that alter the address register first multiply their operands by this value. + uint8_t maximum_operations_per_instruction; // New in DWARF4. The maximum number of individual operations that may be encoded in an instruction. uint8_t default_is_stmt;// The initial value of theis_stmtregister. int8_t line_base; // This parameter affects the meaning of the special opcodes. See below. uint8_t line_range; // This parameter affects the meaning of the special opcodes. See below. Index: source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp +++ source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp @@ -424,6 +424,10 @@ prologue->prologue_length = debug_line_data.GetDWARFOffset(offset_ptr); const lldb::offset_t end_prologue_offset = prologue->prologue_length + *offset_ptr; prologue->min_inst_length = debug_line_data.GetU8(offset_ptr); + if (prologue->version >= 4) + prologue->maximum_operations_per_instruction = debug_line_data.GetU8(offset_ptr); + else + prologue->maximum_operations_per_instruction = 1; prologue->default_is_stmt = debug_line_data.GetU8(offset_ptr); prologue->line_base = debug_line_data.GetU8(offset_ptr); prologue->line_range = debug_line_data.GetU8(offset_ptr); @@ -490,9 +494,12 @@ return false; const dw_offset_t end_prologue_offset = debug_line_data.GetDWARFOffset(&offset) + offset; - // Skip instruction length, default is stmt, line base, line range and - // opcode base, and all opcode lengths + // Skip instruction length, default is stmt, line base, line range offset += 4; + // For DWARF4, skip maximum operations per instruction + if (version >= 4) + offset += 1; + // Skip opcode base, and all opcode lengths const uint8_t opcode_base = debug_line_data.GetU8(&offset); offset += opcode_base - 1; std::vector include_directories;