qemu-e2k/linux-user
Josh Kunz dc12567a53 linux-user: Support gdb 'qOffsets' query for ELF
This is needed to support debugging PIE ELF binaries running under QEMU
user mode. Currently, `code_offset` and `data_offset` remain unset for
all ELF binaries, so GDB is unable to correctly locate the position of
the binary's text and data.

The fields `code_offset`, and `data_offset` were originally added way
back in 2006 to support debugging of bFMT executables (978efd6aac),
and support was just never added for ELF. Since non-PIE binaries are
loaded at exactly the address specified in the binary, GDB does not need
to relocate any symbols, so the buggy behavior is not normally observed.

http://sourceware.org/gdb/onlinedocs/gdb/General-Query-Packets.html#index-qOffsets-packet

Buglink: https://bugs.launchpad.net/qemu/+bug/1528239
Signed-off-by: Josh Kunz <jkz@google.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20190816233422.16715-1-jkz@google.com>
[lv: added link to documentation]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2019-09-11 08:46:52 +02:00
..
aarch64 Supply missing header guards 2019-06-12 13:20:21 +02:00
alpha Supply missing header guards 2019-06-12 13:20:21 +02:00
arm linux-user/arm: Adjust MAX_RESERVED_VA for M-profile 2019-09-11 08:46:34 +02:00
cris Supply missing header guards 2019-06-12 13:20:21 +02:00
generic linux-user: Introduce TARGET_HAVE_ARCH_STRUCT_FLOCK 2019-07-02 16:56:46 +02:00
host linux-user: Add safe_syscall for riscv64 host 2018-12-26 06:40:02 +11:00
hppa linux-user: Make sigaltstack stacks per-thread 2019-07-26 19:24:33 +02:00
i386 Supply missing header guards 2019-06-12 13:20:21 +02:00
m68k linux-user/m68k: remove simulator syscall interface 2019-06-26 17:14:41 +02:00
microblaze Supply missing header guards 2019-06-12 13:20:21 +02:00
mips target/mips: rationalise softfloat includes 2019-08-19 12:07:13 +01:00
mips64 Supply missing header guards 2019-06-12 13:20:21 +02:00
nios2 Supply missing header guards 2019-06-12 13:20:21 +02:00
openrisc target/openrisc: Add support for ORFPX64A32 2019-09-04 12:53:33 -07:00
ppc linux-user: set default PPC64 CPU 2019-06-24 23:10:36 +02:00
riscv RISC-V: Update syscall list for 32-bit support. 2019-06-25 22:37:08 -07:00
s390x Supply missing header guards 2019-06-12 13:20:21 +02:00
sh4 Supply missing header guards 2019-06-12 13:20:21 +02:00
sparc Supply missing header guards 2019-06-12 13:20:21 +02:00
sparc64 Supply missing header guards 2019-06-12 13:20:21 +02:00
tilegx Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
x86_64 Supply missing header guards 2019-06-12 13:20:21 +02:00
xtensa Supply missing header guards 2019-06-12 13:20:21 +02:00
Makefile.objs linux-user/m68k: remove simulator syscall interface 2019-06-26 17:14:41 +02:00
cpu_loop-common.h cpu: Replace ENV_GET_CPU with env_cpu 2019-06-10 07:03:34 -07:00
elfload.c linux-user: Support gdb 'qOffsets' query for ELF 2019-09-11 08:46:52 +02:00
errno_defs.h Supply missing header guards 2019-06-12 13:20:21 +02:00
exit.c linux-user: fix GPROF build failure 2019-05-10 12:44:23 +02:00
fd-trans.c linux-user: move QEMU_IFLA_BR_MULTI_BOOLOPT to the good function 2019-07-02 16:56:46 +02:00
fd-trans.h linux-user: move TargetFdTrans functions to their own file 2018-09-25 22:36:47 +02:00
flat.h Supply missing header guards 2019-06-12 13:20:21 +02:00
flatload.c linux-user/flatload: fix initial stack pointer alignment 2018-10-30 11:23:32 -07:00
ioctls.h linux-user: fix to handle variably sized SIOCGSTAMP with new kernels 2019-07-19 09:33:55 +02:00
linux_loop.h linux-user: Add loop control ioctls 2016-07-19 15:22:33 +03:00
linuxload.c avoid TABs in files that only contain a few 2019-01-11 15:46:56 +01:00
main.c linux-user: Pass CPUState to MAX_RESERVED_VA 2019-09-11 08:46:34 +02:00
mmap.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
qemu.h Include qemu/queue.h slightly less 2019-08-16 13:31:52 +02:00
safe-syscall.S linux-user: Provide safe_syscall for fixing races between signals and syscalls 2016-05-27 14:49:51 +03:00
signal-common.h linux-user: Make sigaltstack stacks per-thread 2019-07-26 19:24:33 +02:00
signal.c linux-user: Make sigaltstack stacks per-thread 2019-07-26 19:24:33 +02:00
socket.h Supply missing header guards 2019-06-12 13:20:21 +02:00
strace.c linux-user: Add support for strace for statx() syscall 2019-07-02 16:56:46 +02:00
strace.list linux-user: Add support for strace for statx() syscall 2019-07-02 16:56:46 +02:00
syscall.c linux-user: add memfd_create 2019-09-11 08:46:17 +02:00
syscall_defs.h linux-user: fix to handle variably sized SIOCGSTAMP with new kernels 2019-07-19 09:33:55 +02:00
syscall_types.h linux-user: fix to handle variably sized SIOCGSTAMP with new kernels 2019-07-19 09:33:55 +02:00
target_flat.h Supply missing header guards 2019-06-12 13:20:21 +02:00
trace-events trace-events: Fix attribution of trace points to source 2019-03-22 16:18:07 +00:00
uaccess.c avoid TABs in files that only contain a few 2019-01-11 15:46:56 +01:00
uname.c cpu: Replace ENV_GET_CPU with env_cpu 2019-06-10 07:03:34 -07:00
uname.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
vm86.c target/i386: Use env_cpu, env_archcpu 2019-06-10 07:03:42 -07:00