* [Qemu-devel] Re: [PATCH] Fix to 'gdb detach' stub
2010-02-22 20:50 [Qemu-devel] " Daniel Gutson
@ 2010-02-22 21:22 ` Daniel Gutson
2010-02-23 10:30 ` Kevin Wolf
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Gutson @ 2010-02-22 21:22 UTC (permalink / raw)
To: qemu-devel
[Re-done with git.]
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.
Signed-off-by: Daniel Gutson <dgutson@codesourcery.com>
---
gdbstub.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
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;
--
1.6.2.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Re: [PATCH] Fix to 'gdb detach' stub
2010-02-22 21:22 ` [Qemu-devel] " Daniel Gutson
@ 2010-02-23 10:30 ` Kevin Wolf
0 siblings, 0 replies; 5+ messages in thread
From: Kevin Wolf @ 2010-02-23 10:30 UTC (permalink / raw)
To: Daniel Gutson; +Cc: qemu-devel
Am 22.02.2010 22:22, schrieb Daniel Gutson:
> [Re-done with git.]
> 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.
>
> Signed-off-by: Daniel Gutson <dgutson@codesourcery.com>
> ---
> gdbstub.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> 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)
This line wrap corrupts the patch. Have you tried git send-email?
> case 'D':
> /* Detach packet */
> gdb_breakpoint_remove_all();
> + gdb_syscall_mode = GDB_SYS_DISABLED;
And indentation is off here (qemu uses four spaces, no tabs).
Kevin
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] Re: Re: [PATCH] Fix to 'gdb detach' stub
@ 2010-02-26 17:13 Daniel Gutson
2010-02-26 17:28 ` [Qemu-devel] " Kevin Wolf
2010-02-27 15:22 ` [Qemu-devel] " Aurelien Jarno
0 siblings, 2 replies; 5+ messages in thread
From: Daniel Gutson @ 2010-02-26 17:13 UTC (permalink / raw)
To: qemu-devel, kwolf, daniel.gutson
Hello Kevin,
please let me know if this works.
If so, please remember that I'd need somebody to commit this for me, since I don't have write-access.
Undoing line wrap and tabs.
Thanks!
Daniel.
[old same text.]
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.
Signed-off-by: Daniel Gutson <dgutson@codesourcery.com>
---
gdbstub.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
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;
--
1.6.2.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] Re: [PATCH] Fix to 'gdb detach' stub
2010-02-26 17:13 [Qemu-devel] Re: Re: [PATCH] Fix to 'gdb detach' stub Daniel Gutson
@ 2010-02-26 17:28 ` Kevin Wolf
2010-02-27 15:22 ` [Qemu-devel] " Aurelien Jarno
1 sibling, 0 replies; 5+ messages in thread
From: Kevin Wolf @ 2010-02-26 17:28 UTC (permalink / raw)
To: Daniel Gutson; +Cc: qemu-devel, daniel.gutson
Hi Daniel,
Am 26.02.2010 18:13, schrieb Daniel Gutson:
> Hello Kevin,
> please let me know if this works.
> If so, please remember that I'd need somebody to commit this for me, since I don't have write-access.
>
> Undoing line wrap and tabs.
I'm not a committer either. The patch format looks fine this time and it
applies cleanly, so I expect it to be picked up by one of the
committers. (If it's not in a week or two, re-post it as a top-level
mail instead of an answer to another mail, so that it's more visible)
Kevin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Re: Re: [PATCH] Fix to 'gdb detach' stub
2010-02-26 17:13 [Qemu-devel] Re: Re: [PATCH] Fix to 'gdb detach' stub Daniel Gutson
2010-02-26 17:28 ` [Qemu-devel] " Kevin Wolf
@ 2010-02-27 15:22 ` Aurelien Jarno
1 sibling, 0 replies; 5+ messages in thread
From: Aurelien Jarno @ 2010-02-27 15:22 UTC (permalink / raw)
To: Daniel Gutson; +Cc: kwolf, qemu-devel, daniel.gutson
On Fri, Feb 26, 2010 at 02:13:50PM -0300, Daniel Gutson wrote:
> Hello Kevin,
> please let me know if this works.
> If so, please remember that I'd need somebody to commit this for me, since I don't have write-access.
>
> Undoing line wrap and tabs.
Thanks applied.
> Thanks!
> Daniel.
>
> [old same text.]
> 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.
>
> Signed-off-by: Daniel Gutson <dgutson@codesourcery.com>
> ---
> gdbstub.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> 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;
> --
> 1.6.2.4
>
>
>
>
>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-02-27 15:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-26 17:13 [Qemu-devel] Re: Re: [PATCH] Fix to 'gdb detach' stub Daniel Gutson
2010-02-26 17:28 ` [Qemu-devel] " Kevin Wolf
2010-02-27 15:22 ` [Qemu-devel] " Aurelien Jarno
-- strict thread matches above, loose matches on Subject: below --
2010-02-22 20:50 [Qemu-devel] " Daniel Gutson
2010-02-22 21:22 ` [Qemu-devel] " Daniel Gutson
2010-02-23 10:30 ` Kevin Wolf
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).