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

Ed Maste emaste at freebsd.org
Tue Apr 8 06:01:57 PDT 2014

On 8 April 2014 05:54, Matthew Gardiner <mg11 at csr.com> wrote:
> 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.

Correct.  The DWARF debug classes originated within LLDB, and were
later reused in LLVM without moving LLDB over to use the new copy.

> 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.

It's not quite that straightforward though, because the LLVM version
has cases for version >= 4, which has an additional field in the
prologue header format.  I'll change the test to < 2 || > 3 for now.

More information about the lldb-commits mailing list