[Lldb-commits] [lldb] r218641 - dwarf: add dwarf v4 maximum_operations_per_instruction to DWARFDebugLine.

Todd Fiala todd.fiala at gmail.com
Mon Sep 29 16:11:09 PDT 2014


Author: tfiala
Date: Mon Sep 29 18:11:09 2014
New Revision: 218641

URL: http://llvm.org/viewvc/llvm-project?rev=218641&view=rev
Log:
dwarf: add dwarf v4 maximum_operations_per_instruction to DWARFDebugLine.

See http://reviews.llvm.org/D5533 for details.

Change by Tong Shen.

Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp?rev=218641&r1=218640&r2=218641&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp Mon Sep 29 18:11:09 2014
@@ -424,6 +424,10 @@ DWARFDebugLine::ParsePrologue(const DWAR
     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 @@ DWARFDebugLine::ParseSupportFiles (const
       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<std::string> include_directories;

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h?rev=218641&r1=218640&r2=218641&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h Mon Sep 29 18:11:09 2014
@@ -75,6 +75,7 @@ public:
         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.





More information about the lldb-commits mailing list