llvm-project/lldb
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
..
bindings [lldb/Plugins] Move SBTarget::GetExtendedCrashInformation to SBProcess 2020-02-24 23:37:04 +01:00
cmake Allow customized relative PYTHONHOME (Attemp 1) 2020-02-21 16:25:30 -08:00
docs [lldb]: fix typo in lldb-gdb-remote.txt 2020-02-20 14:30:12 +01:00
examples [lldb] Make gdbremote.py utility py2and3 compatible 2020-02-13 09:18:55 +01:00
include/lldb [lldb][NFC] Move NameSearchContext to own header/source files 2020-02-25 12:25:36 +01:00
packages/Python/lldbsuite [lldb] Disable auto fix-its when evaluating expressions in the test suite 2020-02-24 09:31:11 +01:00
resources
scripts [lldb/Scripts] Remove swig_bot_lib/__init__.py 2020-01-16 09:15:41 -08:00
source [lldb/gdb-remote] Add support for the qOffsets packet 2020-02-26 10:18:58 +01:00
test [lldb/gdb-remote] Add support for the qOffsets packet 2020-02-26 10:18:58 +01:00
third_party/Python/module Increase timeout in pexpect to lower chances of tests failing under ASAN. 2019-10-10 16:16:49 +00:00
tools Fix a race between lldb's packet timeout and the profile thread's usleep. 2020-02-25 11:17:08 -08:00
unittests [lldb/gdb-remote] Add support for the qOffsets packet 2020-02-26 10:18:58 +01:00
utils [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
.clang-format
.gitignore Add .noindex to the gitignore 2019-04-05 17:57:42 +00:00
CMakeLists.txt [lldb/Cmake] Add a CMakeLists.txt to the utils directory... 2020-01-16 22:31:01 -08:00
CODE_OWNERS.txt [lldb][NFC] Cleanup mentions and code related to lldb-mi 2019-07-19 15:55:23 +00:00
LICENSE.TXT
use_lldb_suite_root.py