/[qemu]/qemu/gdbstub.c
ViewVC logotype

Diff of /qemu/gdbstub.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.31 by bellard, Tue Nov 15 22:16:05 2005 UTC revision 1.32 by bellard, Mon Nov 21 23:25:50 2005 UTC
# Line 47  enum RSState { Line 47  enum RSState {
47  static int gdbserver_fd = -1;  static int gdbserver_fd = -1;
48    
49  typedef struct GDBState {  typedef struct GDBState {
50        CPUState *env; /* current CPU */
51      enum RSState state; /* parsing state */      enum RSState state; /* parsing state */
52      int fd;      int fd;
53      char line_buf[4096];      char line_buf[4096];
# Line 576  static void gdb_vm_stopped(void *opaque, Line 577  static void gdb_vm_stopped(void *opaque,
577      int ret;      int ret;
578    
579      /* disable single step if it was enable */      /* disable single step if it was enable */
580      cpu_single_step(cpu_single_env, 0);      cpu_single_step(s->env, 0);
581    
582      if (reason == EXCP_DEBUG) {      if (reason == EXCP_DEBUG) {
583          tb_flush(cpu_single_env);          tb_flush(s->env);
584          ret = SIGTRAP;          ret = SIGTRAP;
585      }      }
586      else      else
# Line 589  static void gdb_vm_stopped(void *opaque, Line 590  static void gdb_vm_stopped(void *opaque,
590  }  }
591  #endif  #endif
592    
593  static void gdb_read_byte(GDBState *s, CPUState *env, int ch)  static void gdb_read_byte(GDBState *s, int ch)
594  {  {
595        CPUState *env = s->env;
596      int i, csum;      int i, csum;
597      char reply[1];      char reply[1];
598    
# Line 676  gdb_handlesig (CPUState *env, int sig) Line 678  gdb_handlesig (CPUState *env, int sig)
678            int i;            int i;
679    
680            for (i = 0; i < n; i++)            for (i = 0; i < n; i++)
681              gdb_read_byte (s, env, buf[i]);              gdb_read_byte (s, buf[i]);
682          }          }
683        else if (n == 0 || errno != EAGAIN)        else if (n == 0 || errno != EAGAIN)
684          {          {
# Line 721  static void gdb_read(void *opaque) Line 723  static void gdb_read(void *opaque)
723          vm_start();          vm_start();
724      } else {      } else {
725          for(i = 0; i < size; i++)          for(i = 0; i < size; i++)
726              gdb_read_byte(s, cpu_single_env, buf[i]);              gdb_read_byte(s, buf[i]);
727      }      }
728  }  }
729    
# Line 759  static void gdb_accept(void *opaque) Line 761  static void gdb_accept(void *opaque)
761          return;          return;
762      }      }
763  #endif  #endif
764        s->env = first_cpu; /* XXX: allow to change CPU */
765      s->fd = fd;      s->fd = fd;
766    
767      fcntl(fd, F_SETFL, O_NONBLOCK);      fcntl(fd, F_SETFL, O_NONBLOCK);

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26