qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: [PATCH  v2 8/9] gdbstub: ensure we clean-up when terminated
Date: Fri, 18 Dec 2020 11:27:06 +0000	[thread overview]
Message-ID: <20201218112707.28348-9-alex.bennee@linaro.org> (raw)
In-Reply-To: <20201218112707.28348-1-alex.bennee@linaro.org>

If you kill the inferior from GDB we end up leaving our socket lying
around. Fix this by calling gdb_exit() first.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20201214153012.12723-7-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 gdbstub.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gdbstub.c b/gdbstub.c
index bab8476357..8c301edf32 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1978,6 +1978,7 @@ static void handle_v_kill(GdbCmdContext *gdb_ctx, void *user_ctx)
     /* Kill the target */
     put_packet("OK");
     error_report("QEMU: Terminated via GDBstub");
+    gdb_exit(0);
     exit(0);
 }
 
@@ -2539,6 +2540,7 @@ static int gdb_handle_packet(const char *line_buf)
     case 'k':
         /* Kill the target */
         error_report("QEMU: Terminated via GDBstub");
+        gdb_exit(0);
         exit(0);
     case 'D':
         {
-- 
2.20.1



  parent reply	other threads:[~2020-12-18 11:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18 11:26 [PATCH v2 0/9] gdbstub/next (cleanups, softmmu, SVE) Alex Bennée
2020-12-18 11:26 ` [PATCH v2 1/9] test/guest-debug: echo QEMU command as well Alex Bennée
2020-12-18 11:27 ` [PATCH v2 2/9] configure: gate our use of GDB to 8.3.1 or above Alex Bennée
2020-12-18 11:27 ` [PATCH v2 3/9] Revert "tests/tcg/multiarch/Makefile.target: Disable run-gdbstub-sha1 test" Alex Bennée
2020-12-18 11:27 ` [PATCH v2 4/9] gdbstub: implement a softmmu based test Alex Bennée
2020-12-18 14:45   ` Philippe Mathieu-Daudé
2020-12-18 11:27 ` [PATCH v2 5/9] gdbstub: add support to Xfer:auxv:read: packet Alex Bennée
2020-12-18 11:27 ` [PATCH v2 6/9] gdbstub: drop CPUEnv from gdb_exit() Alex Bennée
2020-12-18 11:59   ` Laurent Vivier
2020-12-18 14:10   ` Philippe Mathieu-Daudé
2020-12-18 11:27 ` [PATCH v2 7/9] gdbstub: drop gdbserver_cleanup in favour of gdb_exit Alex Bennée
2020-12-18 14:10   ` Philippe Mathieu-Daudé
2020-12-18 11:27 ` Alex Bennée [this message]
2020-12-18 14:12   ` [PATCH v2 8/9] gdbstub: ensure we clean-up when terminated Philippe Mathieu-Daudé
2020-12-18 11:27 ` [PATCH v2 9/9] target/arm: use official org.gnu.gdb.aarch64.sve layout for registers Alex Bennée
2020-12-18 15:17   ` Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201218112707.28348-9-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).