Search
lxdream.org :: lxdream/src/gui/debug_win.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gui/debug_win.c
changeset 43:0cf3e339cc59
prev35:21a4be098304
next45:f99236f0632e
author nkeynes
date Mon Dec 26 11:47:15 2005 +0000 (14 years ago)
permissions -rw-r--r--
last change Add sh4 + arm breakpoints
Hook up break button in GUI
Enable ARM slice in main loop
file annotate diff log raw
1.1 --- a/src/gui/debug_win.c Mon Dec 26 03:54:55 2005 +0000
1.2 +++ b/src/gui/debug_win.c Mon Dec 26 11:47:15 2005 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: debug_win.c,v 1.12 2005-12-26 03:54:55 nkeynes Exp $
1.6 + * $Id: debug_win.c,v 1.13 2005-12-26 11:47:15 nkeynes Exp $
1.7 * This file is responsible for the main debugger gui frame.
1.8 *
1.9 * Copyright (c) 2005 Nathan Keynes.
1.10 @@ -18,7 +18,7 @@
1.11 #include <stdarg.h>
1.12 #include <gnome.h>
1.13 #include <math.h>
1.14 -#include "gui.h"
1.15 +#include "gui/gui.h"
1.16 #include "mem.h"
1.17 #include "cpu.h"
1.18
1.19 @@ -158,6 +158,17 @@
1.20 posn = gtk_clist_append( data->disasm_list, arr );
1.21 if( buf[0] == '?' )
1.22 gtk_clist_set_foreground( data->disasm_list, posn, &clrWarn );
1.23 + if( data->cpu->get_breakpoint != NULL ) {
1.24 + int type = data->cpu->get_breakpoint( i );
1.25 + switch(type) {
1.26 + case BREAK_ONESHOT:
1.27 + gtk_clist_set_background( data->disasm_list, posn, &clrTempBreak );
1.28 + break;
1.29 + case BREAK_KEEP:
1.30 + gtk_clist_set_background( data->disasm_list, posn, &clrBreak );
1.31 + break;
1.32 + }
1.33 + }
1.34 }
1.35 if( data->disasm_pc != -1 && data->disasm_pc >= from && data->disasm_pc < to )
1.36 gtk_clist_set_foreground( data->disasm_list, address_to_row(data, data->disasm_pc),
1.37 @@ -223,6 +234,30 @@
1.38 }
1.39 }
1.40
1.41 +void debug_win_toggle_breakpoint( debug_info_t data, int row, int type )
1.42 +{
1.43 + uint32_t pc = row_to_address( data, row );
1.44 + int oldType = data->cpu->get_breakpoint( pc );
1.45 + if( oldType != BREAK_NONE ) {
1.46 + data->cpu->clear_breakpoint( pc, oldType );
1.47 + type = BREAK_NONE;
1.48 + } else {
1.49 + if( data->cpu->set_breakpoint != NULL )
1.50 + data->cpu->set_breakpoint( pc, type );
1.51 + }
1.52 + switch(type) {
1.53 + case BREAK_ONESHOT:
1.54 + gtk_clist_set_background( data->disasm_list, row, &clrTempBreak );
1.55 + break;
1.56 + case BREAK_KEEP:
1.57 + gtk_clist_set_background( data->disasm_list, row, &clrBreak );
1.58 + break;
1.59 + default:
1.60 + gtk_clist_set_background( data->disasm_list, row, &clrWhite );
1.61 + break;
1.62 + }
1.63 +}
1.64 +
1.65 /**
1.66 * Execute a single instruction using the current CPU mode.
1.67 */
1.68 @@ -258,7 +293,6 @@
1.69 va_start(ap, msg);
1.70 p = g_strdup_vprintf( msg, ap );
1.71 strftime( buf, sizeof(buf), "%H:%M:%S", localtime(&tm) );
1.72 - // if( source == NULL )
1.73 sprintf( addr, "%08X", *data->cpu->pc );
1.74 arr[3] = p;
1.75 posn = gtk_clist_append(data->msgs_list, arr);
.