/[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 42 by dpavlin, Mon Oct 8 16:22:32 2007 UTC revision 44 by dpavlin, Mon Oct 8 16:22:56 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: debugger.c,v 1.26 2007/06/15 17:02:39 debug Exp $   *  $Id: debugger.c,v 1.27 2007/06/28 14:58:38 debug Exp $
29   *   *
30   *  Single-step debugger.   *  Single-step debugger.
31   *   *
# Line 85  int old_show_trace_tree = 0; Line 85  int old_show_trace_tree = 0;
85    
86  static volatile int ctrl_c;  static volatile int ctrl_c;
87    
88  static int debugger_n_emuls;  static struct emul *debugger_emul;
 static struct emul **debugger_emuls;  
89    
90  /*  Currently focused CPU, machine, and emulation:  */  /*  Currently focused CPU, machine, and emulation:  */
91  int debugger_cur_cpu;  int debugger_cur_cpu;
92  int debugger_cur_machine;  int debugger_cur_machine;
 int debugger_cur_emul;  
93  static struct machine *debugger_machine;  static struct machine *debugger_machine;
94  static struct emul *debugger_emul;  static struct emul *debugger_emul;
95    
# Line 117  char debugger_readchar(void) Line 115  char debugger_readchar(void)
115    
116          while ((ch = console_readchar(MAIN_CONSOLE)) < 0 && !exit_debugger) {          while ((ch = console_readchar(MAIN_CONSOLE)) < 0 && !exit_debugger) {
117                  /*  Check for X11 events:  */                  /*  Check for X11 events:  */
118                  x11_check_event(debugger_emuls, debugger_n_emuls);                  x11_check_event(debugger_emul);
119    
120                  /*  Give up some CPU time:  */                  /*  Give up some CPU time:  */
121                  usleep(10000);                  usleep(10000);
# Line 712  void debugger_reset(void) Line 710  void debugger_reset(void)
710   *   *
711   *  Must be called before any other debugger function is used.   *  Must be called before any other debugger function is used.
712   */   */
713  void debugger_init(struct emul **emuls, int n_emuls)  void debugger_init(struct emul *emul)
714  {  {
715          int i;          int i;
716    
717          debugger_n_emuls = n_emuls;          debugger_emul = emul;
         debugger_emuls = emuls;  
   
         if (n_emuls < 1) {  
                 fprintf(stderr, "\nERROR: No emuls (?)\n");  
                 exit(1);  
         }  
718    
719          debugger_emul = emuls[0];          if (emul->n_machines < 1) {
720          if (emuls[0]->n_machines < 1) {                  fprintf(stderr, "\nERROR: No machines, "
                 fprintf(stderr, "\nERROR: No machines in emuls[0], "  
721                      "cannot handle this situation yet.\n\n");                      "cannot handle this situation yet.\n\n");
722                  exit(1);                  exit(1);
723          }          }
724    
725          debugger_machine = emuls[0]->machines[0];          debugger_machine = emul->machines[0];
726    
727          debugger_cur_cpu = 0;          debugger_cur_cpu = 0;
728          debugger_cur_machine = 0;          debugger_cur_machine = 0;
         debugger_cur_emul = 0;  
729    
730          for (i=0; i<N_PREVIOUS_CMDS; i++) {          for (i=0; i<N_PREVIOUS_CMDS; i++) {
731                  CHECK_ALLOCATION(last_cmd[i] = malloc(MAX_CMD_BUFLEN));                  CHECK_ALLOCATION(last_cmd[i] = malloc(MAX_CMD_BUFLEN));

Legend:
Removed from v.42  
changed lines
  Added in v.44

  ViewVC Help
Powered by ViewVC 1.1.26