qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Gutson <dgutson@codesourcery.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Fix to 'gdb detach' stub
Date: Mon, 22 Feb 2010 17:50:15 -0300	[thread overview]
Message-ID: <4B82EE07.80904@codesourcery.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 682 bytes --]

With this patch, 'gdb detach' correctly resumes the inferior execution 
after detaching the debugger.
The bug was caused by qemu asking gdb to execute a syscall (isatty) 
after the detach, and then waiting (forever) for the reply. I fixed this 
by properly setting gdb_syscall_mode appropriately in the 'detach' 
packet handling, so subsequent syscalls are solved by qemu rather than gdb.

I tested this manually.

Please commit it for me if accepted, since I don't have write privileges.

Thanks!
	Daniel.

2010-02-22  Daniel Gutson  <dgutson@codesourcery.com>

	* gdbstub.c (gdb_handle_packet): set
	gdb_syscall_mode properly.

-- 
Daniel Gutson
CodeSourcery
www.codesourcery.com

[-- Attachment #2: gdbstub.patch --]
[-- Type: text/x-diff, Size: 376 bytes --]

diff --git a/gdbstub.c b/gdbstub.c
index 91c5f68..92bb36d 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1848,6 +1848,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf)
     case 'D':
         /* Detach packet */
         gdb_breakpoint_remove_all();
+	gdb_syscall_mode = GDB_SYS_DISABLED;
         gdb_continue(s);
         put_packet(s, "OK");
         break;

             reply	other threads:[~2010-02-22 20:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-22 20:50 Daniel Gutson [this message]
2010-02-22 21:22 ` [Qemu-devel] Re: [PATCH] Fix to 'gdb detach' stub Daniel Gutson
2010-02-23 10:30   ` Kevin Wolf

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=4B82EE07.80904@codesourcery.com \
    --to=dgutson@codesourcery.com \
    --cc=qemu-devel@nongnu.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).