6d8f77a6 | 09-Oct-2023 |
Akihiko Odaki <akihiko.odaki@daynix.com> |
gdbstub: Use g_markup_printf_escaped()
g_markup_printf_escaped() is a safer alternative to simple printf() as it automatically escapes values.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com
gdbstub: Use g_markup_printf_escaped()
g_markup_printf_escaped() is a safer alternative to simple printf() as it automatically escapes values.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-Id: <20230912224107.29669-9-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20231009164104.369749-16-alex.bennee@linaro.org>
show more ...
|
956af7da | 09-Oct-2023 |
Akihiko Odaki <akihiko.odaki@daynix.com> |
gdbstub: Introduce GDBFeature structure
Before this change, the information from a XML file was stored in an array that is not descriptive. Introduce a dedicated structure type to make it easier to
gdbstub: Introduce GDBFeature structure
Before this change, the information from a XML file was stored in an array that is not descriptive. Introduce a dedicated structure type to make it easier to understand and to extend with more fields.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230912224107.29669-6-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20231009164104.369749-13-alex.bennee@linaro.org>
show more ...
|
5d1ab242 | 09-Oct-2023 |
Akihiko Odaki <akihiko.odaki@daynix.com> |
gdbstub: Fix target.xml response
It was failing to return target.xml after the first request.
Fixes: 56e534bd11 ("gdbstub: refactor get_feature_xml") Signed-off-by: Akihiko Odaki <akihiko.odaki@day
gdbstub: Fix target.xml response
It was failing to return target.xml after the first request.
Fixes: 56e534bd11 ("gdbstub: refactor get_feature_xml") Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-Id: <20230912224107.29669-3-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20231009164104.369749-10-alex.bennee@linaro.org>
show more ...
|
8dd7a4b3 | 29-Aug-2023 |
Alex Bennée <alex.bennee@linaro.org> |
gdbstub: move comment for gdb_register_coprocessor
Use proper kdoc style comments for this API function.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <rich
gdbstub: move comment for gdb_register_coprocessor
Use proper kdoc style comments for this API function.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230829161528.2707696-13-alex.bennee@linaro.org>
show more ...
|
56e534bd | 29-Aug-2023 |
Alex Bennée <alex.bennee@linaro.org> |
gdbstub: refactor get_feature_xml
Try to bring up the code to more modern standards by:
- use dynamic GString built xml over a fixed buffer - use autofree to save on explicit g_free() calls -
gdbstub: refactor get_feature_xml
Try to bring up the code to more modern standards by:
- use dynamic GString built xml over a fixed buffer - use autofree to save on explicit g_free() calls - don't hand hack strstr to find the delimiter - fix up style of xml_builtin and invert loop
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230829161528.2707696-11-alex.bennee@linaro.org>
show more ...
|
5b030993 | 29-Aug-2023 |
Alex Bennée <alex.bennee@linaro.org> |
gdbstub: remove unused user_ctx field
This was always NULL so drop it.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> Signed-off-by: Alex Ben
gdbstub: remove unused user_ctx field
This was always NULL so drop it.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230829161528.2707696-10-alex.bennee@linaro.org>
show more ...
|
f1b0f894 | 10-Aug-2023 |
Alex Bennée <alex.bennee@linaro.org> |
gdbstub: don't complain about preemptive ACK chars
When starting a remote connection GDB sends an '+':
/* Ack any packet which the remote side has already sent. */ remote_serial_write ("+", 1)
gdbstub: don't complain about preemptive ACK chars
When starting a remote connection GDB sends an '+':
/* Ack any packet which the remote side has already sent. */ remote_serial_write ("+", 1);
which gets flagged as a garbage character in the gdbstub state machine. As gdb does send it out lets be permissive about the handling so we can better see real issues.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Cc: gdb-patches@sourceware.org Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230810153640.1879717-9-alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
e282010b | 30-Jun-2023 |
Ilya Leoshkevich <iii@linux.ibm.com> |
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 an
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>
show more ...
|
dc14a7a6 | 30-Jun-2023 |
Ilya Leoshkevich <iii@linux.ibm.com> |
gdbstub: Report the actual qemu-user pid
Currently qemu-user reports pid 1 to GDB. Resolve the TODO and report the actual PID. Using getpid() relies on the assumption that there is only one GDBProce
gdbstub: Report the actual qemu-user pid
Currently qemu-user reports pid 1 to GDB. Resolve the TODO and report the actual PID. Using getpid() relies on the assumption that there is only one GDBProcess. Add an assertion to make sure that future changes don't break it.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Message-Id: <20230621203627.1808446-6-iii@linux.ibm.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230630180423.558337-36-alex.bennee@linaro.org>
show more ...
|
a3fcc111 | 30-Jun-2023 |
Ilya Leoshkevich <iii@linux.ibm.com> |
gdbstub: Expose gdb_get_process() and gdb_get_first_cpu_in_process()
These functions will be needed by user-target.c in order to retrieve the name of the executable.
Reviewed-by: Alex Bennée <alex.
gdbstub: Expose gdb_get_process() and gdb_get_first_cpu_in_process()
These functions will be needed by user-target.c in order to retrieve the name of the executable.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Message-Id: <20230621203627.1808446-5-iii@linux.ibm.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230630180423.558337-35-alex.bennee@linaro.org>
show more ...
|
2261b73c | 30-Jun-2023 |
Alex Bennée <alex.bennee@linaro.org> |
gdbstub: clean-up vcont handling to avoid goto
We can handle all the error exit cases by using g_autofree() for the one thing that needs cleaning up on the exit.
Reviewed-by: Richard Henderson <ric
gdbstub: clean-up vcont handling to avoid goto
We can handle all the error exit cases by using g_autofree() for the one thing that needs cleaning up on the exit.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230630180423.558337-31-alex.bennee@linaro.org>
show more ...
|
3b72d681 | 30-Jun-2023 |
Nicholas Piggin <npiggin@gmail.com> |
gdbstub: Permit reverse step/break to provide stop response
The final part of the reverse step and break handling is to bring the machine back to a debug stop state. gdb expects a response.
A gdb '
gdbstub: Permit reverse step/break to provide stop response
The final part of the reverse step and break handling is to bring the machine back to a debug stop state. gdb expects a response.
A gdb 'rsi' command hangs forever because the gdbstub filters out the response (also observable with reverse_debugging.py avocado tests).
Fix by setting allow_stop_reply for the gdb backward packets.
Fixes: 758370052fb ("gdbstub: only send stop-reply packets when allowed to") Cc: qemu-stable@nongnu.org Cc: Matheus Tavares Bernardino <quic_mathbern@quicinc.com> Cc: Alex Bennée <alex.bennee@linaro.org> Cc: Taylor Simpson <tsimpson@quicinc.com> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Acked-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com> Message-Id: <20230623035304.279833-1-npiggin@gmail.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230630180423.558337-30-alex.bennee@linaro.org>
show more ...
|