[Lldb-commits] [PATCH] Let lldb dump line tables for DWARF v3

Matthew Gardiner mg11 at csr.com
Tue Apr 8 02:54:28 PDT 2014


Hi people,

I have been looking into the support for ARM binary images by lldb. One 
of the ARM tool chains I use produces .debug_line tables as specified by 
DWARF v3. With lldb and llvm-dwarfdump built from the top of the tree, I 
observed that the dwarfdump tool dumps the line table, but lldb does 
not. After some investigation I discovered that the dump tool is built 
against llvm/lib/DebugInfo/DWARFDebugLine.cpp, whereas lldb uses 
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp.

It turned out that the source used by lldb has a subtle difference in 
flow-control with regards the treatment of the line table's prologue 
version number compared to that of the llvm source. After duplication of 
this flow-control, it is possible for lldb to print the line-table built 
according to DWARF standards above and beyond v2.

Could somebody submit the following patch to the lldb tree which fixes 
this issue?

Index: source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
===================================================================
--- source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp	(revision 205611)
+++ source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp	(working copy)
@@ -418,7 +418,7 @@
      const char * s;
      prologue->total_length      = 
debug_line_data.GetDWARFInitialLength(offset_ptr);
      prologue->version           = debug_line_data.GetU16(offset_ptr);
-    if (prologue->version != 2)
+    if (prologue->version < 2)
        return false;

      prologue->prologue_length   = 
debug_line_data.GetDWARFOffset(offset_ptr);
@@ -486,7 +486,7 @@
      (void)debug_line_data.GetDWARFInitialLength(&offset);
      const char * s;
      uint32_t version = debug_line_data.GetU16(&offset);
-    if (version != 2)
+    if (version < 2)
        return false;

      const dw_offset_t end_prologue_offset = 
debug_line_data.GetDWARFOffset(&offset) + offset;


thank you
Matthew Gardiner


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Keep up to date with CSR on our technical blog, www.csr.com/blog, CSR people blog, www.csr.com/people, YouTube, www.youtube.com/user/CSRplc, Facebook, www.facebook.com/pages/CSR/191038434253534, or follow us on Twitter at www.twitter.com/CSR_plc.
New for 2014, you can now access the wide range of products powered by aptX at www.aptx.com.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DWARFDebugLine.cpp.patch
Type: text/x-patch
Size: 954 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20140408/e66ce6c5/attachment.bin>


More information about the lldb-commits mailing list