gdbstub: Add support for info proc mappings
commite282010b2e1e34e1579c933cadf278833d527812
authorIlya Leoshkevich <iii@linux.ibm.com>
Fri, 30 Jun 2023 18:04:21 +0000 (30 19:04 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Mon, 3 Jul 2023 11:52:34 +0000 (3 12:52 +0100)
treee3a4d0115694ef7c27e9d8b58ed7a7a908b96886
parentdc14a7a6e95571122ec2428abb355fe2c43e05c6
gdbstub: Add support for info proc mappings

Currently the GDB's generate-core-file command doesn't work well with
qemu-user: the resulting dumps are huge [1] and at the same time
incomplete (argv and envp are missing). The reason is that GDB has no
access to proc mappings and therefore has to fall back to using
heuristics for discovering them. This is, in turn, because qemu-user
does not implement the Host I/O feature of the GDB Remote Serial
Protocol.

Implement vFile:{open,close,pread,readlink} and also
qXfer:exec-file:read+. With that, generate-core-file begins to work on
aarch64 and s390x.

[1] https://sourceware.org/pipermail/gdb-patches/2023-May/199432.html

Co-developed-by: Dominik 'Disconnect3d' Czarnota <dominik.b.czarnota@gmail.com>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20230621203627.1808446-7-iii@linux.ibm.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230630180423.558337-37-alex.bennee@linaro.org>
gdbstub/gdbstub.c
gdbstub/internals.h
gdbstub/user-target.c