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.101 2005/04/18 21:41:19 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"); |
1349 |
|
|
1350 |
addr = addr_start; |
addr = addr_start; |
1351 |
|
|
|
if ((addr & 3) != 0) |
|
|
printf("WARNING! You entered an unaligned address.\n"); |
|
|
|
|
1352 |
ctrl_c = 0; |
ctrl_c = 0; |
1353 |
|
|
1354 |
while (addr < addr_end) { |
while (addr < addr_end) { |
1355 |
int i, len; |
int i, len; |
1356 |
unsigned char buf[25]; /* TODO: How long can an |
unsigned char buf[32]; /* TODO: How long can an |
1357 |
instruction be, on weird archs? */ |
instruction be, on weird archs? */ |
1358 |
memset(buf, 0, sizeof(buf)); |
memset(buf, 0, sizeof(buf)); |
1359 |
|
|