25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: debugger.c,v 1.98 2005/03/20 20:27:26 debug Exp $ |
* $Id: debugger.c,v 1.103 2005/05/13 14:26:29 debug Exp $ |
29 |
* |
* |
30 |
* Single-step debugger. |
* Single-step debugger. |
31 |
* |
* |
54 |
#include <string.h> |
#include <string.h> |
55 |
#include <unistd.h> |
#include <unistd.h> |
56 |
|
|
57 |
|
#include "bintrans.h" |
58 |
#include "console.h" |
#include "console.h" |
59 |
#include "cpu.h" |
#include "cpu.h" |
60 |
#include "device.h" |
#include "device.h" |
381 |
*/ |
*/ |
382 |
static void debugger_cmd_bintrans(struct machine *m, char *cmd_line) |
static void debugger_cmd_bintrans(struct machine *m, char *cmd_line) |
383 |
{ |
{ |
384 |
|
int i; |
385 |
|
|
386 |
if (*cmd_line == '\0') |
if (*cmd_line == '\0') |
387 |
goto printstate; |
goto printstate; |
388 |
|
|
396 |
cmd_line++; |
cmd_line++; |
397 |
|
|
398 |
/* Note: len 3 and 4, to include the NUL char. */ |
/* Note: len 3 and 4, to include the NUL char. */ |
399 |
if (strncasecmp(cmd_line, "on", 3) == 0) |
if (strncasecmp(cmd_line, "on", 3) == 0) { |
400 |
m->bintrans_enable = 1; |
m->bintrans_enable = 1; |
401 |
else if (strncasecmp(cmd_line, "off", 4) == 0) |
for (i=0; i<m->ncpus; i++) |
402 |
|
bintrans_restart(m->cpus[i]); |
403 |
|
} else if (strncasecmp(cmd_line, "off", 4) == 0) |
404 |
m->bintrans_enable = 0; |
m->bintrans_enable = 0; |
405 |
else |
else |
406 |
printf("syntax: bintrans [on|off]\n"); |
printf("syntax: bintrans [on|off]\n"); |
904 |
printf("Multiple matches. Try prefixing with %%, $, or @.\n"); |
printf("Multiple matches. Try prefixing with %%, $, or @.\n"); |
905 |
break; |
break; |
906 |
case NAME_PARSE_REGISTER: |
case NAME_PARSE_REGISTER: |
907 |
|
printf("%s = 0x%llx\n", cmd_line, (long long)tmp); |
908 |
|
break; |
909 |
case NAME_PARSE_SYMBOL: |
case NAME_PARSE_SYMBOL: |
910 |
printf("%s = 0x%016llx\n", cmd_line, (long long)tmp); |
printf("%s = 0x%016llx\n", cmd_line, (long long)tmp); |
911 |
break; |
break; |
912 |
case NAME_PARSE_NUMBER: |
case NAME_PARSE_NUMBER: |
913 |
printf("0x%016llx\n", (long long)tmp); |
printf("0x%llx\n", (long long)tmp); |
914 |
break; |
break; |
915 |
} |
} |
916 |
} |
} |
1351 |
|
|
1352 |
addr = addr_start; |
addr = addr_start; |
1353 |
|
|
|
if ((addr & 3) != 0) |
|
|
printf("WARNING! You entered an unaligned address.\n"); |
|
|
|
|
1354 |
ctrl_c = 0; |
ctrl_c = 0; |
1355 |
|
|
1356 |
while (addr < addr_end) { |
while (addr < addr_end) { |
1357 |
int i, len; |
int i, len; |
1358 |
unsigned char buf[25]; /* TODO: How long can an |
unsigned char buf[32]; /* TODO: How long can an |
1359 |
instruction be, on weird archs? */ |
instruction be, on weird archs? */ |
1360 |
memset(buf, 0, sizeof(buf)); |
memset(buf, 0, sizeof(buf)); |
1361 |
|
|