491 |
cpu_log(cpu,"BREAKPOINT", |
cpu_log(cpu,"BREAKPOINT", |
492 |
"Virtual breakpoint reached at PC=0x%llx\n",cpu->pc); |
"Virtual breakpoint reached at PC=0x%llx\n",cpu->pc); |
493 |
|
|
494 |
printf("[[[ Virtual Breakpoint reached at PC=0x%llx ]]]\n",cpu->pc); |
printf("[[[ Virtual Breakpoint reached at PC=0x%llx RA=0x%llx]]]\n", |
495 |
|
cpu->pc,cpu->gpr[MIPS_GPR_RA]); |
496 |
|
|
497 |
mips64_dump_regs(cpu); |
mips64_dump_regs(cpu); |
498 |
memlog_dump(cpu); |
memlog_dump(cpu); |
499 |
} |
} |
500 |
|
|
501 |
|
/* Add a virtual breakpoint */ |
502 |
|
int mips64_add_breakpoint(cpu_mips_t *cpu,m_uint64_t pc) |
503 |
|
{ |
504 |
|
int i; |
505 |
|
|
506 |
|
for(i=0;i<MIPS64_MAX_BREAKPOINTS;i++) |
507 |
|
if (!cpu->breakpoints[i]) |
508 |
|
break; |
509 |
|
|
510 |
|
if (i == MIPS64_MAX_BREAKPOINTS) |
511 |
|
return(-1); |
512 |
|
|
513 |
|
cpu->breakpoints[i] = pc; |
514 |
|
cpu->breakpoints_enabled = TRUE; |
515 |
|
return(0); |
516 |
|
} |
517 |
|
|
518 |
|
/* Remove a virtual breakpoint */ |
519 |
|
void mips64_remove_breakpoint(cpu_mips_t *cpu,m_uint64_t pc) |
520 |
|
{ |
521 |
|
int i,j; |
522 |
|
|
523 |
|
for(i=0;i<MIPS64_MAX_BREAKPOINTS;i++) |
524 |
|
if (cpu->breakpoints[i] == pc) |
525 |
|
{ |
526 |
|
for(j=i;j<MIPS64_MAX_BREAKPOINTS-1;j++) |
527 |
|
cpu->breakpoints[j] = cpu->breakpoints[j+1]; |
528 |
|
|
529 |
|
cpu->breakpoints[MIPS64_MAX_BREAKPOINTS-1] = 0; |
530 |
|
} |
531 |
|
|
532 |
|
for(i=0;i<MIPS64_MAX_BREAKPOINTS;i++) |
533 |
|
if (cpu->breakpoints[i] != 0) |
534 |
|
return; |
535 |
|
|
536 |
|
cpu->breakpoints_enabled = TRUE; |
537 |
|
} |
538 |
|
|
539 |
/* Debugging for register-jump to address 0 */ |
/* Debugging for register-jump to address 0 */ |
540 |
fastcall void mips64_debug_jr0(cpu_mips_t *cpu) |
fastcall void mips64_debug_jr0(cpu_mips_t *cpu) |
541 |
{ |
{ |