[Lldb-commits] [PATCH] D55214: Introduce ObjectFileBreakpad

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 3 05:27:47 PST 2018


labath created this revision.
labath added reviewers: clayborg, zturner, lemo, amccarth.
Herald added subscribers: fedor.sergeev, mgorny.

This patch adds the scaffolding necessary for lldb to recognise symbol
files generated by breakpad. These (textual) files contain just enough
information to be able to produce a backtrace from a crash
dump. This information includes:

- UUID, architecture and name of the module
- line tables
- list of symbols
- unwind information

A minimal breakpad file could look like this:
MODULE Linux x86_64 0000000024B5D199F0F766FFFFFF5DC30 a.out
INFO CODE_ID 00000000B52499D1F0F766FFFFFF5DC3
FILE 0 /tmp/a.c
FUNC 1010 10 0 _start
1010 4 4 0
1014 5 5 0
1019 5 6 0
101e 2 7 0
PUBLIC 1010 0 _start
STACK CFI INIT 1010 10 .cfa: $rsp 8 + .ra: .cfa -8 + ^
STACK CFI 1011 $rbp: .cfa -16 + ^ .cfa: $rsp 16 +
STACK CFI 1014 .cfa: $rbp 16 +

Even though this data would normally be considered "symbol" information,
in the current lldb infrastructure it is assumed every SymbolFile object
is backed by an ObjectFile instance. So, in order to better interoperate
with the rest of the code (particularly symbol vendors).

In this patch I just parse the breakpad header, which is enough to
populate the UUID and architecture fields of the ObjectFile interface.
The rough plan for followup patches is to expose the individual parts of
the breakpad file as ObjectFile "sections", which can then be used by
other parts of the codebase (SymbolFileBreakpad ?) to vend the necessary
information.


https://reviews.llvm.org/D55214

Files:
  include/lldb/Symbol/ObjectFile.h
  lit/Modules/Breakpad/Inputs/identification-linux.syms
  lit/Modules/Breakpad/Inputs/identification-macosx.syms
  lit/Modules/Breakpad/Inputs/identification-windows.syms
  lit/Modules/Breakpad/breakpad-identification.test
  lit/Modules/Breakpad/lit.local.cfg
  source/Plugins/ObjectFile/Breakpad/CMakeLists.txt
  source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp
  source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h
  source/Plugins/ObjectFile/CMakeLists.txt
  source/Symbol/ObjectFile.cpp
  tools/lldb-test/SystemInitializerTest.cpp
  tools/lldb-test/lldb-test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55214.176376.patch
Type: text/x-patch
Size: 18952 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20181203/d949f265/attachment-0001.bin>


More information about the lldb-commits mailing list