/[gxemul]/trunk/src/debugger/debugger.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/debugger/debugger.c

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

revision 24 by dpavlin, Mon Oct 8 16:19:56 2007 UTC revision 26 by dpavlin, Mon Oct 8 16:20:10 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: debugger.c,v 1.10 2006/06/16 18:31:26 debug Exp $   *  $Id: debugger.c,v 1.12 2006/06/25 01:25:32 debug Exp $
29   *   *
30   *  Single-step debugger.   *  Single-step debugger.
31   *   *
# Line 86  extern int quiet_mode; Line 86  extern int quiet_mode;
86   *  TODO: Some of these should be moved to some other place!   *  TODO: Some of these should be moved to some other place!
87   */   */
88    
89  volatile int single_step = 0;  volatile int single_step = NOT_SINGLE_STEPPING;
90  volatile int exit_debugger;  volatile int exit_debugger;
91  int force_debugger_at_exit = 0;  int force_debugger_at_exit = 0;
92  int show_opcode_statistics = 0;  int show_opcode_statistics = 0;
# Line 168  void debugger_activate(int x) Line 168  void debugger_activate(int x)
168  {  {
169          ctrl_c = 1;          ctrl_c = 1;
170    
171          if (single_step) {          if (single_step != NOT_SINGLE_STEPPING) {
172                  /*  Already in the debugger. Do nothing.  */                  /*  Already in the debugger. Do nothing.  */
173                  int i;                  int i;
174                  for (i=0; i<MAX_CMD_BUFLEN; i++)                  for (i=0; i<MAX_CMD_BUFLEN; i++)
# Line 179  void debugger_activate(int x) Line 179  void debugger_activate(int x)
179                  fflush(stdout);                  fflush(stdout);
180          } else {          } else {
181                  /*  Enter the single step debugger.  */                  /*  Enter the single step debugger.  */
182                  single_step = 1;                  single_step = ENTER_SINGLE_STEPPING;
183    
184                  /*  Discard any chars in the input queue:  */                  /*  Discard any chars in the input queue:  */
185                  while (console_charavail(MAIN_CONSOLE))                  while (console_charavail(MAIN_CONSOLE))
# Line 792  void debugger(void) Line 792  void debugger(void)
792           */           */
793          /*  TODO: In all machines  */          /*  TODO: In all machines  */
794          for (i=0; i<debugger_machine->ncpus; i++)          for (i=0; i<debugger_machine->ncpus; i++)
795                  if (debugger_machine->cpus[i]->translation_cache != NULL)                  if (debugger_machine->cpus[i]->translation_cache != NULL) {
796                          cpu_create_or_reset_tc(debugger_machine->cpus[i]);                          cpu_create_or_reset_tc(debugger_machine->cpus[i]);
797                            debugger_machine->cpus[i]->
798                                invalidate_translation_caches(
799                                debugger_machine->cpus[i], 0, INVALIDATE_ALL);
800                    }
801    
802          /*          /*
803           *  Ugly GDB hack: After single stepping, we need to send back           *  Ugly GDB hack: After single stepping, we need to send back
# Line 858  void debugger(void) Line 862  void debugger(void)
862          gettimeofday(&debugger_machine->starttime, NULL);          gettimeofday(&debugger_machine->starttime, NULL);
863          debugger_machine->ncycles_since_gettimeofday = 0;          debugger_machine->ncycles_since_gettimeofday = 0;
864    
865          single_step = 0;          single_step = NOT_SINGLE_STEPPING;
866          debugger_machine->instruction_trace = old_instruction_trace;          debugger_machine->instruction_trace = old_instruction_trace;
867          debugger_machine->show_trace_tree = old_show_trace_tree;          debugger_machine->show_trace_tree = old_show_trace_tree;
868          quiet_mode = old_quiet_mode;          quiet_mode = old_quiet_mode;

Legend:
Removed from v.24  
changed lines
  Added in v.26

  ViewVC Help
Powered by ViewVC 1.1.26