Skip to content

Fix GDB semihosting

Meador Inge qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest1 patch 2 repliesIn review
  2. v11 patch 7 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1gdbserver: Don't send a GDB syscall until the system CPU is stoppedgdbstub.c+28 -162 replies

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchPeter Maydell
1/1R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 0/1] Fix GDB semihosting

Hi All,

GDB semihosting support is broken in the current trunk. When debugging a basic "Hello, World" application via the QEMU GDB stub:

   $ qemu-system-arm -s -S -M integratorcp -cpu any --semihosting
     --monitor null --serial null -kernel hello

GDB (7.2.50) receives an interrupt before anything is printed:

Program received signal SIGINT, Interrupt.

The fundamental issue is that the GDB server implementation sends syscall requests while the system CPU is still running and isn't prepared to handle the replies. This patch fixes the problem by delaying syscall request until the system CPU has stopped.

* Changes from v1
- At the suggestion of Peter Maydell I changed the implementation to delay sending syscall requests until the CPU has stopped instead of incorrectly attempting to just suppress the sending of 'T' status replies.

Meador Inge (1):
gdbserver: Don't send a GDB syscall until the system CPU is stopped

 gdbstub.c |   44 ++++++++++++++++++++++++++++----------------
 1 files changed, 28 insertions(+), 16 deletions(-)
Signature · 1 line
1.7.7.6