Timing and initialization fixes

This commit is contained in:
Aaron Culliney 2015-09-06 15:15:33 -07:00
parent 7d4b63e12d
commit f557941d07
2 changed files with 9 additions and 7 deletions

View File

@ -86,9 +86,8 @@ extern const struct opcode_struct *opcodes;
void c_interface_debugging();
#endif
void c_debugger_init();
void c_debugger_go();
bool c_debugger_should_break();
void c_debugger_go(void);
bool c_debugger_should_break(void);
void c_debugger_set_timeout(const unsigned int secs);
bool c_debugger_set_watchpoint(const uint16_t addr);

View File

@ -1144,7 +1144,7 @@ static int begin_cpu_stepping() {
bool saved_fullspeed = is_fullspeed;
cpu_scale_factor = CPU_SCALE_FASTEST;
cpu_altscale_factor = CPU_SCALE_FASTEST;
is_fullspeed = true;
timing_initialize();
unsigned int idx = 0;
size_t textlen = 0;
@ -1198,7 +1198,7 @@ static int begin_cpu_stepping() {
cpu_scale_factor = saved_scale;
cpu_altscale_factor = saved_altscale;
is_fullspeed = saved_fullspeed;
timing_initialize();
return ch;
}
@ -1336,8 +1336,11 @@ void display_help() {
num_buffer_lines = i;
}
void c_debugger_init() {
/* reset the watchpoints and breakpoints */
__attribute__((constructor(CTOR_PRIORITY_LATE)))
static void _init_debugger(void) {
LOG("Initializing virtual machine debugger subsystem");
for (unsigned int i=0; i<MAX_BRKPTS; i++)
{
breakpoints[i] = -1;