diff mbox

[v1,1/1] gdbserver: Keep VM state status replies from happening during a syscall

Message ID 1329324914-12296-2-git-send-email-meadori@codesourcery.com
State New
Headers show

Commit Message

Meador Inge Feb. 15, 2012, 4:55 p.m. UTC
Fix an issue where the GDB server implementation was allowing 'RUN_STATE_DEBUG'
transitions to send a signal trap status back to the GDB client while a syscall
is being processed.  This eventually resulted in sending a SIGINT to the GDB
client.

Signed-off-by: Meador Inge <meadori@codesourcery.com>
---
 gdbstub.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Comments

Blue Swirl Feb. 15, 2012, 5:54 p.m. UTC | #1
On Wed, Feb 15, 2012 at 16:55, Meador Inge <meadori@codesourcery.com> wrote:
> Fix an issue where the GDB server implementation was allowing 'RUN_STATE_DEBUG'
> transitions to send a signal trap status back to the GDB client while a syscall
> is being processed.  This eventually resulted in sending a SIGINT to the GDB
> client.
>
> Signed-off-by: Meador Inge <meadori@codesourcery.com>
> ---
>  gdbstub.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/gdbstub.c b/gdbstub.c
> index 7d470b6..34d2717 100644
> --- a/gdbstub.c
> +++ b/gdbstub.c
> @@ -2480,7 +2480,6 @@ void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...)
>  #ifndef CONFIG_USER_ONLY
>     vm_stop(RUN_STATE_DEBUG);
>  #endif
> -    s->state = RS_IDLE;
>     va_start(va, fmt);
>     p = buf;
>     *(p++) = 'F';
> @@ -2557,6 +2556,8 @@ static void gdb_read_byte(GDBState *s, int ch)
>  #endif
>     {
>         switch(s->state) {
> +        case RS_SYSCALL:
> +            s->state = RS_IDLE;

Missing break statement or a comment about fallthrough.

>         case RS_IDLE:
>             if (ch == '$') {
>                 s->line_buf_index = 0;
> --
> 1.7.7.6
>
>
diff mbox

Patch

diff --git a/gdbstub.c b/gdbstub.c
index 7d470b6..34d2717 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -2480,7 +2480,6 @@  void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...)
 #ifndef CONFIG_USER_ONLY
     vm_stop(RUN_STATE_DEBUG);
 #endif
-    s->state = RS_IDLE;
     va_start(va, fmt);
     p = buf;
     *(p++) = 'F';
@@ -2557,6 +2556,8 @@  static void gdb_read_byte(GDBState *s, int ch)
 #endif
     {
         switch(s->state) {
+        case RS_SYSCALL:
+            s->state = RS_IDLE;
         case RS_IDLE:
             if (ch == '$') {
                 s->line_buf_index = 0;