/[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 28 by dpavlin, Mon Oct 8 16:20:26 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.14 2006/07/01 21:15:46 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;
 int show_opcode_statistics = 0;  
92    
93  volatile int single_step_breakpoint = 0;  volatile int single_step_breakpoint = 0;
94  int debugger_n_steps_left_before_interaction = 0;  int debugger_n_steps_left_before_interaction = 0;
# Line 168  void debugger_activate(int x) Line 167  void debugger_activate(int x)
167  {  {
168          ctrl_c = 1;          ctrl_c = 1;
169    
170          if (single_step) {          if (single_step != NOT_SINGLE_STEPPING) {
171                  /*  Already in the debugger. Do nothing.  */                  /*  Already in the debugger. Do nothing.  */
172                  int i;                  int i;
173                  for (i=0; i<MAX_CMD_BUFLEN; i++)                  for (i=0; i<MAX_CMD_BUFLEN; i++)
# Line 179  void debugger_activate(int x) Line 178  void debugger_activate(int x)
178                  fflush(stdout);                  fflush(stdout);
179          } else {          } else {
180                  /*  Enter the single step debugger.  */                  /*  Enter the single step debugger.  */
181                  single_step = 1;                  single_step = ENTER_SINGLE_STEPPING;
182    
183                  /*  Discard any chars in the input queue:  */                  /*  Discard any chars in the input queue:  */
184                  while (console_charavail(MAIN_CONSOLE))                  while (console_charavail(MAIN_CONSOLE))
# Line 792  void debugger(void) Line 791  void debugger(void)
791           */           */
792          /*  TODO: In all machines  */          /*  TODO: In all machines  */
793          for (i=0; i<debugger_machine->ncpus; i++)          for (i=0; i<debugger_machine->ncpus; i++)
794                  if (debugger_machine->cpus[i]->translation_cache != NULL)                  if (debugger_machine->cpus[i]->translation_cache != NULL) {
795                          cpu_create_or_reset_tc(debugger_machine->cpus[i]);                          cpu_create_or_reset_tc(debugger_machine->cpus[i]);
796                            debugger_machine->cpus[i]->
797                                invalidate_translation_caches(
798                                debugger_machine->cpus[i], 0, INVALIDATE_ALL);
799                    }
800    
801          /*          /*
802           *  Ugly GDB hack: After single stepping, we need to send back           *  Ugly GDB hack: After single stepping, we need to send back
# Line 856  void debugger(void) Line 859  void debugger(void)
859          }          }
860    
861          gettimeofday(&debugger_machine->starttime, NULL);          gettimeofday(&debugger_machine->starttime, NULL);
862          debugger_machine->ncycles_since_gettimeofday = 0;          debugger_machine->ninstrs_since_gettimeofday = 0;
863    
864          single_step = 0;          single_step = NOT_SINGLE_STEPPING;
865          debugger_machine->instruction_trace = old_instruction_trace;          debugger_machine->instruction_trace = old_instruction_trace;
866          debugger_machine->show_trace_tree = old_show_trace_tree;          debugger_machine->show_trace_tree = old_show_trace_tree;
867          quiet_mode = old_quiet_mode;          quiet_mode = old_quiet_mode;

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

  ViewVC Help
Powered by ViewVC 1.1.26