* Tracer: fixed RTS padding
* Tracer: always force Trace Logger update when a breakpoint is hit * Debugger: always open Debugger window when a breakpoint is hit
This commit is contained in:
parent
f22dc51e71
commit
7b99bfc321
|
@ -633,32 +633,36 @@ bool inDebugger = false;
|
||||||
void FCEUD_DebugBreakpoint(int bp_num)
|
void FCEUD_DebugBreakpoint(int bp_num)
|
||||||
{
|
{
|
||||||
// log the Breakpoint Hit into Trace Logger log if needed
|
// log the Breakpoint Hit into Trace Logger log if needed
|
||||||
if (logging && (logging_options & LOG_MESSAGES))
|
if (logging)
|
||||||
{
|
{
|
||||||
char str_temp[500];
|
log_old_emu_paused = false; // force Trace Logger update
|
||||||
if (bp_num >= 0)
|
if (logging_options & LOG_MESSAGES)
|
||||||
{
|
{
|
||||||
// normal breakpoint
|
char str_temp[500];
|
||||||
sprintf(str_temp, "Breakpoint %u Hit at $%04X: ", bp_num, X.PC);
|
if (bp_num >= 0)
|
||||||
strcat(str_temp, BreakToText(bp_num));
|
{
|
||||||
//watchpoint[num].condText
|
// normal breakpoint
|
||||||
OutputLogLine(str_temp);
|
sprintf(str_temp, "Breakpoint %u Hit at $%04X: ", bp_num, X.PC);
|
||||||
} else if (bp_num == BREAK_TYPE_BADOP)
|
strcat(str_temp, BreakToText(bp_num));
|
||||||
{
|
//watchpoint[num].condText
|
||||||
sprintf(str_temp, "Bad Opcode Breakpoint Hit at $%04X", X.PC);
|
OutputLogLine(str_temp);
|
||||||
OutputLogLine(str_temp);
|
} else if (bp_num == BREAK_TYPE_BADOP)
|
||||||
} else if (bp_num == BREAK_TYPE_CYCLES_EXCEED)
|
{
|
||||||
{
|
sprintf(str_temp, "Bad Opcode Breakpoint Hit at $%04X", X.PC);
|
||||||
sprintf(str_temp, "Breakpoint Hit at $%04X: cycles count %lu exceeds %lu", X.PC, (long)(timestampbase + timestamp - total_cycles_base), (long)break_cycles_limit);
|
OutputLogLine(str_temp);
|
||||||
OutputLogLine(str_temp);
|
} else if (bp_num == BREAK_TYPE_CYCLES_EXCEED)
|
||||||
} else if (bp_num == BREAK_TYPE_INSTRUCTIONS_EXCEED)
|
{
|
||||||
{
|
sprintf(str_temp, "Breakpoint Hit at $%04X: cycles count %lu exceeds %lu", X.PC, (long)(timestampbase + timestamp - total_cycles_base), (long)break_cycles_limit);
|
||||||
sprintf(str_temp, "Breakpoint Hit at $%04X: instructions count %lu exceeds %lu", X.PC, (long)total_instructions, (long)break_instructions_limit);
|
OutputLogLine(str_temp);
|
||||||
OutputLogLine(str_temp);
|
} else if (bp_num == BREAK_TYPE_INSTRUCTIONS_EXCEED)
|
||||||
|
{
|
||||||
|
sprintf(str_temp, "Breakpoint Hit at $%04X: instructions count %lu exceeds %lu", X.PC, (long)total_instructions, (long)break_instructions_limit);
|
||||||
|
OutputLogLine(str_temp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateDebugger(true);
|
DoDebug(0);
|
||||||
UpdateOtherDebuggingDialogs(); // Keeps the debugging windows updating smoothly when stepping
|
UpdateOtherDebuggingDialogs(); // Keeps the debugging windows updating smoothly when stepping
|
||||||
|
|
||||||
if (bp_num >= 0)
|
if (bp_num >= 0)
|
||||||
|
|
|
@ -455,23 +455,22 @@ void FCEUD_TraceInstruction(uint8 *opcode, int size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (size == 1 && GetMem(addr - 1) == 0x60)
|
if (size == 1 && GetMem(addr) == 0x60)
|
||||||
{
|
{
|
||||||
// special case: an RTS opcode
|
// special case: an RTS opcode
|
||||||
// add "----------" to emphasize the end of subroutine
|
// add "----------" to emphasize the end of subroutine
|
||||||
strcat(str_disassembly, " ");
|
strcat(str_disassembly, " ");
|
||||||
for (int i = strlen(str_disassembly); i < (LOG_DISASSEMBLY_MAX_LEN - 1); ++i)
|
int i = strlen(str_disassembly);
|
||||||
|
for (; i < (LOG_DISASSEMBLY_MAX_LEN - 2); ++i)
|
||||||
str_disassembly[i] = '-';
|
str_disassembly[i] = '-';
|
||||||
str_disassembly[LOG_DISASSEMBLY_MAX_LEN - 1] = 0;
|
str_disassembly[i] = 0;
|
||||||
} else
|
}
|
||||||
|
// stretch the disassembly string out if we have to output other stuff.
|
||||||
|
if ((logging_options & (LOG_REGISTERS|LOG_PROCESSOR_STATUS)) && !(logging_options & LOG_TO_THE_LEFT))
|
||||||
{
|
{
|
||||||
// stretch the disassembly string out if we have to output other stuff.
|
for (int i = strlen(str_disassembly); i < (LOG_DISASSEMBLY_MAX_LEN - 1); ++i)
|
||||||
if ((logging_options & (LOG_REGISTERS|LOG_PROCESSOR_STATUS)) && !(logging_options & LOG_TO_THE_LEFT))
|
str_disassembly[i] = ' ';
|
||||||
{
|
str_disassembly[LOG_DISASSEMBLY_MAX_LEN - 1] = 0;
|
||||||
for (int i = strlen(str_disassembly); i < (LOG_DISASSEMBLY_MAX_LEN - 1); ++i)
|
|
||||||
str_disassembly[i] = ' ';
|
|
||||||
str_disassembly[LOG_DISASSEMBLY_MAX_LEN - 1] = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start filling the str_temp line: Frame number, AXYS state, Processor status, Tabs, Address, Data, Disassembly
|
// Start filling the str_temp line: Frame number, AXYS state, Processor status, Tabs, Address, Data, Disassembly
|
||||||
|
|
Loading…
Reference in New Issue