comparison debug.c @ 794:792be135d3af

Spawn a terminal for the debugger when needed if we are not already attached to one
author Michael Pavone <pavone@retrodev.com>
date Sun, 26 Jul 2015 01:11:04 -0700
parents 724bbec47f86
children cc05444a4a4e
comparison
equal deleted inserted replaced
793:9aff36a172b2 794:792be135d3af
6 #ifndef _WIN32 6 #ifndef _WIN32
7 #include <sys/select.h> 7 #include <sys/select.h>
8 #endif 8 #endif
9 #include "render.h" 9 #include "render.h"
10 #include "util.h" 10 #include "util.h"
11 #include "terminal.h"
11 12
12 static bp_def * breakpoints = NULL; 13 static bp_def * breakpoints = NULL;
13 static bp_def * zbreakpoints = NULL; 14 static bp_def * zbreakpoints = NULL;
14 static uint32_t bp_index = 0; 15 static uint32_t bp_index = 0;
15 static uint32_t zbp_index = 0; 16 static uint32_t zbp_index = 0;
285 static char last_cmd[1024]; 286 static char last_cmd[1024];
286 char input_buf[1024]; 287 char input_buf[1024];
287 static uint16_t branch_t; 288 static uint16_t branch_t;
288 static uint16_t branch_f; 289 static uint16_t branch_f;
289 z80inst inst; 290 z80inst inst;
291 init_terminal();
290 //Check if this is a user set breakpoint, or just a temporary one 292 //Check if this is a user set breakpoint, or just a temporary one
291 bp_def ** this_bp = find_breakpoint(&zbreakpoints, address); 293 bp_def ** this_bp = find_breakpoint(&zbreakpoints, address);
292 if (*this_bp) { 294 if (*this_bp) {
293 printf("Z80 Breakpoint %d hit\n", (*this_bp)->index); 295 printf("Z80 Breakpoint %d hit\n", (*this_bp)->index);
294 } else { 296 } else {
471 static char last_cmd[1024]; 473 static char last_cmd[1024];
472 char input_buf[1024]; 474 char input_buf[1024];
473 static uint32_t branch_t; 475 static uint32_t branch_t;
474 static uint32_t branch_f; 476 static uint32_t branch_f;
475 m68kinst inst; 477 m68kinst inst;
478
479 init_terminal();
480
476 sync_components(context, 0); 481 sync_components(context, 0);
477 //probably not necessary, but let's play it safe 482 //probably not necessary, but let's play it safe
478 address &= 0xFFFFFF; 483 address &= 0xFFFFFF;
479 if (address == branch_t) { 484 if (address == branch_t) {
480 bp_def ** f_bp = find_breakpoint(&breakpoints, branch_f); 485 bp_def ** f_bp = find_breakpoint(&breakpoints, branch_f);