llvm-project/lldb/unittests/Symbol
Jonas Devlieghere cf3524a574
[lldb] Introduce new SymbolFileJSON and ObjectFileJSON
Introduce a new object and symbol file format with the goal of mapping
addresses to symbol names. I'd like to think of is as an extremely
simple textual symtab. The file format consists of a triple, a UUID and
a list of symbols. JSON is used for the encoding, but that's mostly an
implementation detail. The goal of the format was to be simple and human
readable.

The new file format is motivated by two use cases:

 - Stripped binaries: when a binary is stripped, you lose the ability to
   do thing like setting symbolic breakpoints. You can keep the
   unstripped binary around, but if all you need is the stripped
   symbols then that's a lot of overhead. Instead, we could save the
   stripped symbols to a file and load them in the debugger when
   needed. I want to extend llvm-strip to have a mode where it emits
   this new file format.

 - Interactive crashlogs: with interactive crashlogs, if we don't have
   the binary or the dSYM for a particular module, we currently show an
   unnamed symbol for those frames. This is a regression compared to the
   textual format, that has these frames pre-symbolicated. Given that
   this information is available in the JSON crashlog, we need a way to
   tell LLDB about it. With the new symbol file format, we can easily
   synthesize a symbol file for each of those modules and load them to
   symbolicate those frames.

Here's an example of the file format:

 {
     "triple": "arm64-apple-macosx13.0.0",
     "uuid": "36D0CCE7-8ED2-3CA3-96B0-48C1764DA908",
     "symbols": [
         {
             "name": "main",
             "type": "code",
             "size": 32,
             "address": 4294983568
         },
         {
             "name": "foo",
             "type": "code",
             "size": 8,
             "address": 4294983560
         }
     ]
 }

Differential revision: https://reviews.llvm.org/D145180
2023-03-08 20:56:11 -08:00
..
Inputs
CMakeLists.txt [lldb] Introduce new SymbolFileJSON and ObjectFileJSON 2023-03-08 20:56:11 -08:00
JSONSymbolTest.cpp [lldb] Introduce new SymbolFileJSON and ObjectFileJSON 2023-03-08 20:56:11 -08:00
LocateSymbolFileTest.cpp
MangledTest.cpp
PostfixExpressionTest.cpp Remove the dependency between lib/DebugInfoDWARF and MC. 2022-12-15 18:23:27 -08:00
SymbolTest.cpp
SymtabTest.cpp
TestClangASTImporter.cpp Make CompilerType safe 2022-11-16 15:51:26 -08:00
TestDWARFCallFrameInfo.cpp
TestLineEntry.cpp [lldb] Use std::optional instead of llvm::Optional (NFC) 2023-01-07 14:18:35 -08:00
TestType.cpp
TestTypeSystem.cpp
TestTypeSystemClang.cpp [lldb][Test][NFC] TestCreateClassTemplateDecl: make variable names more readable 2023-01-27 03:46:50 +00:00