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 392:39e596b3b6dd
prev144:7f0714e89aaa
next415:5e57f29bfd4d
author nkeynes
date Tue Sep 18 10:48:57 2007 +0000 (14 years ago)
permissions -rw-r--r--
last change Remove debugger from default startup - now only shown if started with -D
file annotate diff log raw
1.1 --- a/src/gui/debug_win.c Mon May 15 08:28:52 2006 +0000
1.2 +++ b/src/gui/debug_win.c Tue Sep 18 10:48:57 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: debug_win.c,v 1.19 2006-05-15 08:28:52 nkeynes Exp $
1.6 + * $Id: debug_win.c,v 1.20 2007-09-18 10:48:57 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 @@ -19,6 +19,7 @@
1.11 #include <stdio.h>
1.12 #include <gnome.h>
1.13 #include <math.h>
1.14 +#include "sh4/sh4dasm.h"
1.15 #include "gui/gui.h"
1.16 #include "mem.h"
1.17 #include "cpu.h"
1.18 @@ -26,6 +27,7 @@
1.19
1.20 GdkColor *msg_colors[] = { &clrError, &clrError, &clrWarn, &clrNormal,
1.21 &clrDebug, &clrTrace };
1.22 +char *msg_levels[] = { "FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE" };
1.23
1.24 void init_register_list( debug_info_t data );
1.25
1.26 @@ -34,7 +36,7 @@
1.27 int disasm_to;
1.28 int disasm_pc;
1.29 struct cpu_desc_struct *cpu;
1.30 - struct cpu_desc_struct **cpu_list;
1.31 + const cpu_desc_t *cpu_list;
1.32 GtkCList *msgs_list;
1.33 GtkCList *regs_list;
1.34 GtkCList *disasm_list;
1.35 @@ -130,9 +132,11 @@
1.36
1.37 void update_icount( debug_info_t data )
1.38 {
1.39 - // sprintf( data->icounter_text, "%d", *data->cpu->icount );
1.40 - sprintf( data->icounter_text, "%d", pvr2_get_frame_count() );
1.41 - gtk_progress_bar_set_text( data->icounter, data->icounter_text );
1.42 + if( data != NULL ) {
1.43 + // sprintf( data->icounter_text, "%d", *data->cpu->icount );
1.44 + sprintf( data->icounter_text, "%d", pvr2_get_frame_count() );
1.45 + gtk_progress_bar_set_text( data->icounter, data->icounter_text );
1.46 + }
1.47 }
1.48
1.49 void set_disassembly_region( debug_info_t data, unsigned int page )
1.50 @@ -292,7 +296,10 @@
1.51 else data = (debug_info_t)ptr;
1.52 va_start(ap, msg);
1.53
1.54 + strftime( buf, sizeof(buf), "%H:%M:%S", localtime(&tm) );
1.55 +
1.56 if( data == NULL ) {
1.57 + fprintf( stderr, "%s %08X %-5s ", buf, *sh4_cpu_desc.pc, msg_levels[level] );
1.58 vfprintf( stderr, msg, ap );
1.59 fprintf( stderr, "\n" );
1.60 va_end(ap);
1.61 @@ -300,7 +307,6 @@
1.62 }
1.63
1.64 p = g_strdup_vprintf( msg, ap );
1.65 - strftime( buf, sizeof(buf), "%H:%M:%S", localtime(&tm) );
1.66 sprintf( addr, "%08X", *data->cpu->pc );
1.67 arr[3] = p;
1.68 posn = gtk_clist_append(data->msgs_list, arr);
1.69 @@ -333,8 +339,10 @@
1.70
1.71 void debug_win_set_running( debug_info_t data, gboolean isRunning )
1.72 {
1.73 - debug_win_enable_widget( data, "stop_btn", isRunning );
1.74 - debug_win_enable_widget( data, "step_btn", !isRunning );
1.75 - debug_win_enable_widget( data, "run_btn", !isRunning );
1.76 - debug_win_enable_widget( data, "runto_btn", !isRunning );
1.77 + if( data != NULL ) {
1.78 + debug_win_enable_widget( data, "stop_btn", isRunning );
1.79 + debug_win_enable_widget( data, "step_btn", !isRunning );
1.80 + debug_win_enable_widget( data, "run_btn", !isRunning );
1.81 + debug_win_enable_widget( data, "runto_btn", !isRunning );
1.82 + }
1.83 }
.