llvm-project/lldb/unittests
Pavel Labath d4eca120ac [lldb/gdb-remote] Add support for the qOffsets packet
Summary:
This packet is necessary to make lldb work with the remote-gdb stub in
user mode qemu when running position-independent binaries. It reports
the relative position (load bias) of the loaded executable wrt. the
addresses in the file itself.

Lldb needs to know this information in order to correctly set the load
address of the executable. Normally, lldb would be able to find this out
on its own by following the breadcrumbs in the process auxiliary vector,
but we can't do this here because qemu does not support the
qXfer:auxv:read packet.

This patch does not implement full scope of the qOffsets packet (it only
supports packets with identical code, data and bss offsets), because it
is not fully clear how should the different offsets be handled and I am
not aware of a producer which would make use of this feature (qemu will
always
<https://github.com/qemu/qemu/blob/master/linux-user/elfload.c#L2436>
return the same value for code and data offsets). In fact, even gdb
ignores the offset for the bss sections, and uses the "data" offset
instead.  So, until the we need more of this packet, I think it's best
to stick to the simplest solution possible. This patch simply rejects
replies with non-uniform offsets.

Reviewers: clayborg, jasonmolenda

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D74598
2020-02-26 10:18:58 +01:00
..
Breakpoint [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Core [lldb][NFCI] Remove unused LanguageType parameters 2020-01-30 21:57:23 -08:00
DataFormatter [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Disassembler [lldb/Plugins] Rename lldbPluginDisassemblerLLVM (NFC) 2020-02-17 19:14:01 -08:00
Editline [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Expression [lldb][NFC] Move NameSearchContext to own header/source files 2020-02-25 12:25:36 +01:00
Host Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Interpreter Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Language Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
ObjectFile [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Platform [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Process [lldb/gdb-remote] Add support for the qOffsets packet 2020-02-26 10:18:58 +01:00
ScriptInterpreter [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Signals [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Symbol [lldb] Refactor and test TypeSystemClang::GetEnumerationIntegerType 2020-02-18 09:52:49 +01:00
SymbolFile [lldb][NFC] Fix compilation of SymbolFilePDBTests.cpp after FindNamespace API change 2020-02-18 11:25:12 +01:00
Target [lldb] Delete register info definitions in the x86_64 ABI classes 2020-02-17 14:01:36 +01:00
TestingSupport [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
UnwindAssembly [lldb/Plugins] Rename lldbPluginDisassemblerLLVM (NFC) 2020-02-17 19:14:01 -08:00
Utility [LLDB] Let DataExtractor deal with two-byte addresses 2020-02-25 16:27:38 +01:00
debugserver [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
tools [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
CMakeLists.txt [FormatManager] Add a unittest for GetCandidateLanguages() 2019-12-10 13:42:59 -08:00
gtest_common.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00