[all-commits] [llvm/llvm-project] cf3524: [lldb] Introduce new SymbolFileJSON and ObjectFile...
Jonas Devlieghere via All-commits
all-commits at lists.llvm.org
Wed Mar 8 20:56:24 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: cf3524a5746f9498280b3a9180b75575c0065d1a
https://github.com/llvm/llvm-project/commit/cf3524a5746f9498280b3a9180b75575c0065d1a
Author: Jonas Devlieghere <jonas at devlieghere.com>
Date: 2023-03-08 (Wed, 08 Mar 2023)
Changed paths:
M lldb/include/lldb/Symbol/Symbol.h
M lldb/source/Plugins/ObjectFile/CMakeLists.txt
A lldb/source/Plugins/ObjectFile/JSON/CMakeLists.txt
A lldb/source/Plugins/ObjectFile/JSON/ObjectFileJSON.cpp
A lldb/source/Plugins/ObjectFile/JSON/ObjectFileJSON.h
M lldb/source/Plugins/SymbolFile/CMakeLists.txt
A lldb/source/Plugins/SymbolFile/JSON/CMakeLists.txt
A lldb/source/Plugins/SymbolFile/JSON/SymbolFileJSON.cpp
A lldb/source/Plugins/SymbolFile/JSON/SymbolFileJSON.h
M lldb/source/Symbol/Symbol.cpp
A lldb/test/API/macosx/symbols/Makefile
A lldb/test/API/macosx/symbols/TestSymbolFileJSON.py
A lldb/test/API/macosx/symbols/main.c
M lldb/unittests/Symbol/CMakeLists.txt
A lldb/unittests/Symbol/JSONSymbolTest.cpp
Log Message:
-----------
[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
More information about the All-commits
mailing list