Skip to contentSkip to conversation

Fix to 'gdb detach' stub

PATCH Applied Daniel Gutson 3 participants 3 messages Feb 26, 2010 – Feb 27, 2010

lore
Share & tools
lore
#0 lore raw

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.

---
 gdbstub.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
gdbstub.c +1 -0
index 91c5f68..92bb36d 100644
@@ -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;
Signature · 1 line
1.6.2.4
#1 lore raw

Hi Daniel,

Am 26.02.2010 18:13, schrieb Daniel Gutson:

Quoted 5 lines

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

#2 lore raw
In reply to Daniel Gutson
Quoted 5 lines · 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 applied.

Quoted 35 lines

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.

---
 gdbstub.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
gdbstub.c +1 -0
index 91c5f68..92bb36d 100644
@@ -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;
Signature · 1 line
1.6.2.4
Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net