debugger.cc Source File

Back to the index.

debugger.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2004-2009 Anders Gavare. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * 3. The name of the author may not be used to endorse or promote products
13  * derived from this software without specific prior written permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25  * SUCH DAMAGE.
26  *
27  *
28  * Single-step debugger.
29  *
30  *
31  * This entire module is very much non-reentrant. :-/ TODO: Fix.
32  */
33 
34 #include <ctype.h>
35 #include <signal.h>
36 #include <stdio.h>
37 #include <stdlib.h>
38 #include <string.h>
39 #include <unistd.h>
40 
41 #include "console.h"
42 #include "cpu.h"
43 #include "device.h"
44 #include "debugger.h"
45 #include "diskimage.h"
46 #include "emul.h"
47 #include "machine.h"
48 #include "memory.h"
49 #include "misc.h"
50 #include "net.h"
51 #include "settings.h"
52 #include "timer.h"
53 #include "x11.h"
54 
55 
56 extern int extra_argc;
57 extern char **extra_argv;
58 extern struct settings *global_settings;
59 extern int quiet_mode;
60 
61 
62 /*
63  * Global debugger variables:
64  *
65  * TODO: Some of these should be moved to some other place!
66  */
67 
69 volatile int exit_debugger;
71 
72 volatile int single_step_breakpoint = 0;
74 
78 
79 
80 /*
81  * Private (global) debugger variables:
82  */
83 
84 static volatile int ctrl_c;
85 
86 /* Currently focused CPU, machine, and emulation: */
89 static struct machine *debugger_machine;
90 static struct emul *debugger_emul;
91 
92 #define MAX_CMD_BUFLEN 72
93 #define N_PREVIOUS_CMDS 150
94 static char *last_cmd[N_PREVIOUS_CMDS];
95 static int last_cmd_index;
96 
97 static char repeat_cmd[MAX_CMD_BUFLEN];
98 
99 #define MAGIC_UNTOUCHED 0x98ca76c2ffcc0011ULL
100 
101 static uint64_t last_dump_addr = MAGIC_UNTOUCHED;
102 static uint64_t last_unasm_addr = MAGIC_UNTOUCHED;
103 
104 
105 /*
106  * debugger_readchar():
107  */
109 {
110  int ch;
111 
112  while ((ch = console_readchar(MAIN_CONSOLE)) < 0 && !exit_debugger) {
113  /* Check for X11 events: */
114  x11_check_event(debugger_emul);
115 
116  /* Give up some CPU time: */
117  usleep(10000);
118  }
119  return ch;
120 }
121 
122 
123 /*
124  * debugger_activate():
125  *
126  * This is a signal handler for CTRL-C. It shouldn't be called directly,
127  * but setup code in emul.c sets the CTRL-C signal handler to use this
128  * function.
129  */
130 void debugger_activate(int x)
131 {
132  ctrl_c = 1;
133 
135  /* Already in the debugger. Do nothing. */
136  int i;
137  for (i=0; i<MAX_CMD_BUFLEN; i++)
141  printf("^C");
142  fflush(stdout);
143  } else {
144  /* Enter the single step debugger. */
146 
147  /* Discard any chars in the input queue: */
150  }
151 
152  /* Clear the repeat-command buffer: */
153  repeat_cmd[0] = '\0';
154 
155  /* Reactivate the signal handler: */
156  signal(SIGINT, debugger_activate);
157 }
158 
159 
160 /*
161  * show_breakpoint():
162  */
163 static void show_breakpoint(struct machine *m, int i)
164 {
165  printf("%3i: 0x", i);
166  if (m->cpus[0]->is_32bit)
167  printf("%08" PRIx32, (uint32_t) m->breakpoints.addr[i]);
168  else
169  printf("%016" PRIx64, (uint64_t) m->breakpoints.addr[i]);
170  if (m->breakpoints.string[i] != NULL)
171  printf(" (%s)", m->breakpoints.string[i]);
172  printf("\n");
173 }
174 
175 
176 /****************************************************************************/
177 
178 
179 #include "debugger_cmds.cc"
180 
181 
182 /****************************************************************************/
183 
184 
185 /*
186  * debugger_assignment():
187  *
188  * cmd contains something like "pc=0x80001000", or "r31=memcpy+0x40".
189  */
190 void debugger_assignment(struct machine *m, char *cmd)
191 {
192  char *left, *right;
193  int res_left, res_right;
194  uint64_t tmp;
195  uint64_t old_pc = m->cpus[0]->pc; /* TODO: multiple cpus? */
196 
197  CHECK_ALLOCATION(left = (char *) malloc(MAX_CMD_BUFLEN));
198  strlcpy(left, cmd, MAX_CMD_BUFLEN);
199  right = strchr(left, '=');
200  if (right == NULL) {
201  fprintf(stderr, "internal error in the debugger\n");
202  exit(1);
203  }
204  *right = '\0';
205 
206  /* Remove trailing spaces in left: */
207  while (strlen(left) >= 1 && left[strlen(left)-1] == ' ')
208  left[strlen(left)-1] = '\0';
209 
210  /* Remove leading spaces in right: */
211  right++;
212  while (*right == ' ' && *right != '\0')
213  right++;
214 
215  /* printf("left = '%s'\nright = '%s'\n", left, right); */
216 
217  res_right = debugger_parse_expression(m, right, 0, &tmp);
218  switch (res_right) {
219  case PARSE_NOMATCH:
220  printf("No match for the right-hand side of the assignment.\n");
221  break;
222  case PARSE_MULTIPLE:
223  printf("Multiple matches for the right-hand side of the "
224  "assignment.\n");
225  break;
226  default:
227  res_left = debugger_parse_expression(m, left, 1, &tmp);
228  switch (res_left) {
229  case PARSE_NOMATCH:
230  printf("No match for the left-hand side of the "
231  "assignment.\n");
232  break;
233  case PARSE_MULTIPLE:
234  printf("Multiple matches for the left-hand side "
235  "of the assignment.\n");
236  break;
237  default:
238  debugger_cmd_print(m, left);
239  }
240  }
241 
242  /*
243  * If the PC has changed, then release any breakpoint we were
244  * currently stopped at.
245  *
246  * TODO: multiple cpus?
247  */
248  if (old_pc != m->cpus[0]->pc)
250 
251  free(left);
252 }
253 
254 
255 /*
256  * debugger_execute_cmd():
257  */
258 void debugger_execute_cmd(char *cmd, int cmd_len)
259 {
260  int i, n, i_match, matchlen;
261 
262  /*
263  * Is there a '=' on the command line? Then try to do an
264  * assignment. (Only if there is just one word, followed
265  * by the '=' sign. This makes it possible to use commands
266  * such as "device add name addr=xyz".)
267  */
268  if (strchr(cmd, '=') != NULL) {
269  /* Count the nr of words: */
270  int nw = 0, inword = 0;
271  char *p = cmd;
272  while (*p) {
273  if (*p == '=')
274  break;
275  if (*p != ' ') {
276  if (!inword)
277  nw ++;
278  inword = 1;
279  } else
280  inword = 0;
281  p++;
282  }
283 
284  if (nw == 1) {
285  debugger_assignment(debugger_machine, cmd);
286  return;
287  }
288  }
289 
290  i = 0;
291  while (cmds[i].name != NULL)
292  cmds[i++].tmp_flag = 0;
293 
294  /* How many chars in cmd to match against: */
295  matchlen = 0;
296  while (isalpha((int)cmd[matchlen]))
297  matchlen ++;
298 
299  /* Check for a command name match: */
300  n = i = i_match = 0;
301  while (cmds[i].name != NULL) {
302  if (strncasecmp(cmds[i].name, cmd, matchlen) == 0
303  && cmds[i].f != NULL) {
304  cmds[i].tmp_flag = 1;
305  i_match = i;
306  n++;
307  }
308  i++;
309  }
310 
311  /* No match? */
312  if (n == 0) {
313  printf("Unknown command '%s'. Type 'help' for help.\n", cmd);
314  return;
315  }
316 
317  /* More than one match? */
318  if (n > 1) {
319  printf("Ambiguous command '%s': ", cmd);
320  i = 0;
321  while (cmds[i].name != NULL) {
322  if (cmds[i].tmp_flag)
323  printf(" %s", cmds[i].name);
324  i++;
325  }
326  printf("\n");
327  return;
328  }
329 
330  /* Exactly one match: */
331  if (cmds[i_match].f != NULL) {
332  char *p = cmd + matchlen;
333  /* Remove leading whitespace from the args... */
334  while (*p != '\0' && *p == ' ')
335  p++;
336 
337  /* ... and run the command: */
338  cmds[i_match].f(debugger_machine, p);
339  } else
340  printf("FATAL ERROR: internal error in debugger.c:"
341  " no handler for this command?\n");
342 }
343 
344 
345 /*
346  * debugger_readline():
347  *
348  * Read a line from the terminal.
349  */
350 static char *debugger_readline(void)
351 {
352  int ch, i, j, n, i_match, reallen, cmd_len, cursor_pos;
353  int read_from_index = last_cmd_index;
354  char *cmd = last_cmd[last_cmd_index];
355 
356  cmd_len = 0; cmd[0] = '\0';
357  printf("GXemul> ");
358  fflush(stdout);
359 
360  ch = '\0';
361  cmd_len = 0;
362  cursor_pos = 0;
363 
364  while (ch != '\n' && !exit_debugger) {
365  ch = debugger_readchar();
366 
367  if ((ch == '\b' || ch == 127) && cursor_pos > 0) {
368  /* Backspace. */
369  cursor_pos --;
370  cmd_len --;
371  memmove(cmd + cursor_pos, cmd + cursor_pos + 1,
372  cmd_len);
373  cmd[cmd_len] = '\0';
374  printf("\b");
375  for (i=cursor_pos; i<cmd_len; i++)
376  printf("%c", cmd[i]);
377  printf(" \b");
378  for (i=cursor_pos; i<cmd_len; i++)
379  printf("\b");
380  } else if (ch == 4 && cmd_len > 0 && cursor_pos < cmd_len) {
381  /* CTRL-D: Delete. */
382  cmd_len --;
383  memmove(cmd + cursor_pos, cmd + cursor_pos + 1,
384  cmd_len);
385  cmd[cmd_len] = '\0';
386  for (i=cursor_pos; i<cmd_len; i++)
387  printf("%c", cmd[i]);
388  printf(" \b");
389  for (i=cursor_pos; i<cmd_len; i++)
390  printf("\b");
391  } else if (ch == 1) {
392  /* CTRL-A: Start of line. */
393  while (cursor_pos > 0) {
394  cursor_pos --;
395  printf("\b");
396  }
397  } else if (ch == 2) {
398  /* CTRL-B: Backwards one character. */
399  if (cursor_pos > 0) {
400  printf("\b");
401  cursor_pos --;
402  }
403  } else if (ch == 5) {
404  /* CTRL-E: End of line. */
405  while (cursor_pos < cmd_len) {
406  printf("%c", cmd[cursor_pos]);
407  cursor_pos ++;
408  }
409  } else if (ch == 6) {
410  /* CTRL-F: Forward one character. */
411  if (cursor_pos < cmd_len) {
412  printf("%c",
413  cmd[cursor_pos]);
414  cursor_pos ++;
415  }
416  } else if (ch == 11) {
417  /* CTRL-K: Kill to end of line. */
418  for (i=0; i<MAX_CMD_BUFLEN; i++)
419  console_makeavail(MAIN_CONSOLE, 4); /* :-) */
420  } else if (ch == 14 || ch == 16) {
421  /* CTRL-P: Previous line in the command history,
422  CTRL-N: next line */
423  do {
424  if (ch == 14 &&
425  read_from_index == last_cmd_index)
426  break;
427  if (ch == 16)
428  i = read_from_index - 1;
429  else
430  i = read_from_index + 1;
431 
432  if (i < 0)
433  i = N_PREVIOUS_CMDS - 1;
434  if (i >= N_PREVIOUS_CMDS)
435  i = 0;
436 
437  /* Special case: pressing 'down'
438  to reach last_cmd_index: */
439  if (i == last_cmd_index) {
440  read_from_index = i;
441  for (i=cursor_pos; i<cmd_len;
442  i++)
443  printf(" ");
444  for (i=cmd_len-1; i>=0; i--)
445  printf("\b \b");
446  cmd[0] = '\0';
447  cmd_len = cursor_pos = 0;
448  } else if (last_cmd[i][0] != '\0') {
449  /* Copy from old line: */
450  read_from_index = i;
451  for (i=cursor_pos; i<cmd_len;
452  i++)
453  printf(" ");
454  for (i=cmd_len-1; i>=0; i--)
455  printf("\b \b");
456  strlcpy(cmd,
457  last_cmd[read_from_index],
459  cmd_len = strlen(cmd);
460  printf("%s", cmd);
461  cursor_pos = cmd_len;
462  }
463  } while (0);
464  } else if (ch >= ' ' && cmd_len < MAX_CMD_BUFLEN-1) {
465  /* Visible character: */
466  memmove(cmd + cursor_pos + 1, cmd + cursor_pos,
467  cmd_len - cursor_pos);
468  cmd[cursor_pos] = ch;
469  cmd_len ++;
470  cursor_pos ++;
471  cmd[cmd_len] = '\0';
472  printf("%c", ch);
473  for (i=cursor_pos; i<cmd_len; i++)
474  printf("%c", cmd[i]);
475  for (i=cursor_pos; i<cmd_len; i++)
476  printf("\b");
477  } else if (ch == '\r' || ch == '\n') {
478  ch = '\n';
479  printf("\n");
480  } else if (ch == '\t') {
481  /* Super-simple tab-completion: */
482  i = 0;
483  while (cmds[i].name != NULL)
484  cmds[i++].tmp_flag = 0;
485 
486  /* Check for a (partial) command match: */
487  n = i = i_match = 0;
488  while (cmds[i].name != NULL) {
489  if (strncasecmp(cmds[i].name, cmd,
490  cmd_len) == 0) {
491  cmds[i].tmp_flag = 1;
492  i_match = i;
493  n++;
494  }
495  i++;
496  }
497 
498  switch (n) {
499  case 0: /* Beep. */
500  printf("\a");
501  break;
502  case 1: /* Add the rest of the command: */
503  reallen = strlen(cmds[i_match].name);
504  for (i=cmd_len; i<reallen; i++)
506  cmds[i_match].name[i]);
507  /* ... and a space, if the command takes
508  any arguments: */
509  if (cmds[i_match].args != NULL &&
510  cmds[i_match].args[0] != '\0')
512  break;
513  default:
514  /* Show all possible commands: */
515  printf("\a\n"); /* Beep. :-) */
516  i = 0; /* i = cmds index */
517  j = 0; /* j = # of cmds printed */
518  while (cmds[i].name != NULL) {
519  if (cmds[i].tmp_flag) {
520  size_t q;
521  if (j == 0)
522  printf(" ");
523  printf("%s",
524  cmds[i].name);
525  j++;
526  if (j != 6)
527  for (q=0; q<13-strlen(
528  cmds[i].name); q++)
529  printf(" ");
530  if (j == 6) {
531  printf("\n");
532  j = 0;
533  }
534  }
535  i++;
536  }
537  if (j != 0)
538  printf("\n");
539  printf("GXemul> ");
540  for (i=0; i<cmd_len; i++)
541  printf("%c", cmd[i]);
542  }
543  } else if (ch == 27) {
544  /* Escape codes: (cursor keys etc) */
545  while ((ch = console_readchar(MAIN_CONSOLE)) < 0)
546  usleep(10000);
547  if (ch == '[' || ch == 'O') {
548  while ((ch = console_readchar(MAIN_CONSOLE))
549  < 0)
550  usleep(10000);
551  switch (ch) {
552  case '2': /* 2~ = ins */
553  case '5': /* 5~ = pgup */
554  case '6': /* 6~ = pgdn */
555  /* TODO: Ugly hack, but might work. */
556  while ((ch = console_readchar(
557  MAIN_CONSOLE)) < 0)
558  usleep(10000);
559  /* Do nothing for these keys. */
560  break;
561  case '3': /* 3~ = delete */
562  /* TODO: Ugly hack, but might work. */
563  while ((ch = console_readchar(
564  MAIN_CONSOLE)) < 0)
565  usleep(10000);
567  break;
568  case 'A': /* Up. */
569  /* Up cursor ==> CTRL-P */
571  break;
572  case 'B': /* Down. */
573  /* Down cursor ==> CTRL-N */
575  break;
576  case 'C':
577  /* Right cursor ==> CTRL-F */
579  break;
580  case 'D': /* Left */
581  /* Left cursor ==> CTRL-B */
583  break;
584  case 'F':
585  /* End ==> CTRL-E */
587  break;
588  case 'H':
589  /* Home ==> CTRL-A */
591  break;
592  }
593  }
594  }
595 
596  fflush(stdout);
597  }
598 
599  if (exit_debugger)
600  cmd[0] = '\0';
601 
602  return cmd;
603 }
604 
605 
606 /*
607  * debugger():
608  *
609  * This is a loop, which reads a command from the terminal, and executes it.
610  */
611 void debugger(void)
612 {
613  int i, cmd_len;
614  char *cmd;
615 
618  return;
619  }
620 
621  /*
622  * Clear all dyntrans translations, because otherwise things would
623  * become to complex to keep in sync.
624  */
625  /* TODO: In all machines */
626  for (i=0; i<debugger_machine->ncpus; i++)
627  if (debugger_machine->cpus[i]->translation_cache != NULL) {
628  cpu_create_or_reset_tc(debugger_machine->cpus[i]);
629  debugger_machine->cpus[i]->
630  invalidate_translation_caches(
631  debugger_machine->cpus[i], 0, INVALIDATE_ALL);
632  }
633 
634  /* Stop timers while interacting with the user: */
635  timer_stop();
636 
637  exit_debugger = 0;
638 
639  while (!exit_debugger) {
640  /* Read a line from the terminal: */
641  cmd = debugger_readline();
642 
643  cmd_len = strlen(cmd);
644 
645  /* Remove spaces: */
646  while (cmd_len > 0 && cmd[0]==' ')
647  memmove(cmd, cmd+1, cmd_len --);
648  while (cmd_len > 0 && cmd[cmd_len-1] == ' ')
649  cmd[(cmd_len--)-1] = '\0';
650 
651  /* No command? Then try reading another line. */
652  if (cmd_len == 0) {
653  /* Special case for repeated commands: */
654  if (repeat_cmd[0] != '\0')
655  strlcpy(cmd, repeat_cmd, MAX_CMD_BUFLEN);
656  else
657  continue;
658  } else {
659  last_cmd_index ++;
660  if (last_cmd_index >= N_PREVIOUS_CMDS)
661  last_cmd_index = 0;
662 
663  repeat_cmd[0] = '\0';
664  }
665 
666  debugger_execute_cmd(cmd, cmd_len);
667 
668  /* Special hack for the "step" command: */
669  if (exit_debugger == -1)
670  return;
671  }
672 
673  /* Start up timers again: */
674  timer_start();
675 
676  /* ... and reset starttime, so that nr of instructions per second
677  can be calculated correctly: */
678  for (i=0; i<debugger_machine->ncpus; i++) {
679  gettimeofday(&debugger_machine->cpus[i]->starttime, NULL);
680  debugger_machine->cpus[i]->ninstrs_since_gettimeofday = 0;
681  }
682 
684  debugger_machine->instruction_trace = old_instruction_trace;
685  debugger_machine->show_trace_tree = old_show_trace_tree;
687 }
688 
689 
690 /*
691  * debugger_reset():
692  *
693  * This function should be called before calling debugger(), when it is
694  * absolutely necessary that debugger() is interactive. Otherwise, it might
695  * return without doing anything, such as when single-stepping multiple
696  * instructions at a time.
697  */
698 void debugger_reset(void)
699 {
701 }
702 
703 
704 /*
705  * debugger_init():
706  *
707  * Must be called before any other debugger function is used.
708  */
709 void debugger_init(struct emul *emul)
710 {
711  int i;
712 
713  debugger_emul = emul;
714 
715  if (emul->n_machines < 1) {
716  fprintf(stderr, "\nERROR: No machines, "
717  "cannot handle this situation yet.\n\n");
718  exit(1);
719  }
720 
721  debugger_machine = emul->machines[0];
722 
723  debugger_cur_cpu = 0;
725 
726  for (i=0; i<N_PREVIOUS_CMDS; i++) {
727  CHECK_ALLOCATION(last_cmd[i] = (char *) malloc(MAX_CMD_BUFLEN));
728  last_cmd[i][0] = '\0';
729  }
730 
731  last_cmd_index = 0;
732  repeat_cmd[0] = '\0';
733 }
734 
PARSE_NOMATCH
#define PARSE_NOMATCH
Definition: debugger.h:52
old_show_trace_tree
int old_show_trace_tree
Definition: debugger.cc:77
debugger_readchar
char debugger_readchar(void)
Definition: debugger.cc:108
f
void f(int s, int func, int only_name)
Definition: generate_arm_r.c:45
debugger_reset
void debugger_reset(void)
Definition: debugger.cc:698
PARSE_MULTIPLE
#define PARSE_MULTIPLE
Definition: debugger.h:53
debugger_assignment
void debugger_assignment(struct machine *m, char *cmd)
Definition: debugger.cc:190
debugger_n_steps_left_before_interaction
int debugger_n_steps_left_before_interaction
Definition: debugger.cc:73
cpu::translation_cache
unsigned char * translation_cache
Definition: cpu.h:431
cmd::f
void(* f)(struct machine *, char *cmd_line)
Definition: debugger_cmds.cc:1193
machine::breakpoints
struct breakpoints breakpoints
Definition: machine.h:159
diskimage.h
settings.h
console_makeavail
void console_makeavail(int handle, char ch)
Definition: console.cc:296
machine::cpus
struct cpu ** cpus
Definition: machine.h:140
extra_argv
char ** extra_argv
Definition: main.cc:62
breakpoints::string
char ** string
Definition: machine.h:59
single_step_breakpoint
volatile int single_step_breakpoint
Definition: debugger.cc:72
machine::show_trace_tree
int show_trace_tree
Definition: machine.h:164
N_PREVIOUS_CMDS
#define N_PREVIOUS_CMDS
Definition: debugger.cc:93
MAX_CMD_BUFLEN
#define MAX_CMD_BUFLEN
Definition: debugger.cc:92
emul::n_machines
int n_machines
Definition: emul.h:45
exit_debugger
volatile int exit_debugger
Definition: debugger.cc:69
cmd::tmp_flag
int tmp_flag
Definition: debugger_cmds.cc:1192
x11_check_event
void x11_check_event(struct emul *emul)
Definition: x11.cc:53
debugger_execute_cmd
void debugger_execute_cmd(char *cmd, int cmd_len)
Definition: debugger.cc:258
timer_start
void timer_start(void)
Definition: timer.cc:206
console.h
console_charavail
int console_charavail(int handle)
Definition: console.cc:347
force_debugger_at_exit
int force_debugger_at_exit
Definition: debugger.cc:70
cpu::ninstrs_since_gettimeofday
int64_t ninstrs_since_gettimeofday
Definition: cpu.h:343
old_instruction_trace
int old_instruction_trace
Definition: debugger.cc:75
device.h
emul::name
char * name
Definition: emul.h:40
debugger_cmds.cc
cmd
Definition: debugger_cmds.cc:1189
debugger_parse_expression
int debugger_parse_expression(struct machine *m, char *expr, int writeflag, uint64_t *valuep)
Definition: debugger_expr.cc:244
machine::instruction_trace
int instruction_trace
Definition: machine.h:162
debugger.h
ENTER_SINGLE_STEPPING
#define ENTER_SINGLE_STEPPING
Definition: debugger.h:48
cpu::starttime
struct timeval starttime
Definition: cpu.h:344
strlen
void COMBINE() strlen(struct cpu *cpu, struct arm_instr_call *ic, int low_addr)
Definition: cpu_arm_instr.cc:2686
single_step
volatile int single_step
Definition: debugger.cc:68
debugger
void debugger(void)
Definition: debugger.cc:611
debugger_activate
void debugger_activate(int x)
Definition: debugger.cc:130
misc.h
debugger_cur_machine
int debugger_cur_machine
Definition: debugger.cc:88
machine.h
machine
Definition: machine.h:97
console_readchar
int console_readchar(int handle)
Definition: console.cc:390
timer.h
breakpoints::addr
uint64_t * addr
Definition: machine.h:60
emul.h
INVALIDATE_ALL
#define INVALIDATE_ALL
Definition: cpu.h:481
cpu::is_32bit
uint8_t is_32bit
Definition: cpu.h:350
cpu.h
old_quiet_mode
int old_quiet_mode
Definition: debugger.cc:76
debugger_init
void debugger_init(struct emul *emul)
Definition: debugger.cc:709
settings
Definition: settings.cc:57
x11.h
NOT_SINGLE_STEPPING
#define NOT_SINGLE_STEPPING
Definition: debugger.h:47
cpu_create_or_reset_tc
void cpu_create_or_reset_tc(struct cpu *cpu)
Definition: cpu.cc:298
emul
Definition: emul.h:37
emul::machines
struct machine ** machines
Definition: emul.h:46
MAIN_CONSOLE
#define MAIN_CONSOLE
Definition: console.h:37
net.h
global_settings
struct settings * global_settings
Definition: main.cc:59
extra_argc
int extra_argc
Definition: main.cc:61
MAGIC_UNTOUCHED
#define MAGIC_UNTOUCHED
Definition: debugger.cc:99
debugger_cur_cpu
int debugger_cur_cpu
Definition: debugger.cc:87
timer_stop
void timer_stop(void)
Definition: timer.cc:245
cpu::pc
uint64_t pc
Definition: cpu.h:386
memory.h
machine::ncpus
int ncpus
Definition: machine.h:139
CHECK_ALLOCATION
#define CHECK_ALLOCATION(ptr)
Definition: misc.h:239
quiet_mode
int quiet_mode
Definition: main.cc:78

Generated on Tue Aug 25 2020 19:25:06 for GXemul by doxygen 1.8.18