Search
lxdream.org :: lxdream/src/gui/callbacks.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gui/callbacks.c
changeset 9:2784c7660165
prev2:42349f6ea216
next10:c898b37506e0
author nkeynes
date Thu Dec 08 13:38:00 2005 +0000 (14 years ago)
permissions -rw-r--r--
last change Generalise the core debug window to allow multiple instances.
Add cpu description structure to define different cpus for use by the
debug window, in preparation for ARM implementation
file annotate diff log raw
1.1 --- a/src/gui/callbacks.c Sat Aug 21 06:15:49 2004 +0000
1.2 +++ b/src/gui/callbacks.c Thu Dec 08 13:38:00 2005 +0000
1.3 @@ -10,7 +10,6 @@
1.4 #include "sh4core.h"
1.5 #include "asic.h"
1.6
1.7 -extern int disasm_from;
1.8 int selected_pc = -1;
1.9
1.10 void
1.11 @@ -107,14 +106,14 @@
1.12 }
1.13
1.14
1.15 -void run( uint32_t target ) {
1.16 +void run( debug_info_t data, uint32_t target ) {
1.17 if( ! sh4_isrunning() ) {
1.18 do {
1.19 if( target == -1 )
1.20 sh4_runfor(1000000);
1.21 else
1.22 sh4_runto(target, 1000000);
1.23 - update_icount();
1.24 + update_icount(data);
1.25 run_timers(1000000);
1.26 while( gtk_events_pending() )
1.27 gtk_main_iteration();
1.28 @@ -127,7 +126,8 @@
1.29 on_run_btn_clicked (GtkButton *button,
1.30 gpointer user_data)
1.31 {
1.32 - run(-1);
1.33 + debug_info_t data = get_debug_info(GTK_WIDGET(button));
1.34 + run(data,-1);
1.35 }
1.36
1.37
1.38 @@ -135,11 +135,12 @@
1.39 on_runto_btn_clicked (GtkButton *button,
1.40 gpointer user_data)
1.41 {
1.42 + debug_info_t data = get_debug_info(GTK_WIDGET(button));
1.43 if( selected_pc == -1 )
1.44 WARN( "No address selected, so can't run to it", NULL );
1.45 else {
1.46 INFO( "Running until %08X...", selected_pc );
1.47 - run( selected_pc );
1.48 + run( data, selected_pc );
1.49 }
1.50 }
1.51
1.52 @@ -169,7 +170,8 @@
1.53 GdkEvent *event,
1.54 gpointer user_data)
1.55 {
1.56 - selected_pc = disasm_from + (row<<1);
1.57 + debug_info_t data = get_debug_info(GTK_WIDGET(clist));
1.58 + selected_pc = row_to_address(data, row);
1.59 }
1.60
1.61
1.62 @@ -180,7 +182,8 @@
1.63 GdkEvent *event,
1.64 gpointer user_data)
1.65 {
1.66 - int pc = disasm_from + (row<<1);
1.67 + debug_info_t data = get_debug_info(GTK_WIDGET(clist));
1.68 + int pc = row_to_address(data,row);
1.69 if( selected_pc == pc ) selected_pc = -1;
1.70 }
1.71
1.72 @@ -233,15 +236,16 @@
1.73 gpointer user_data)
1.74 {
1.75 if( event->keyval == GDK_Return || event->keyval == GDK_Linefeed ) {
1.76 + debug_info_t data = get_debug_info(widget);
1.77 gchar *text = gtk_entry_get_text( GTK_ENTRY(widget) );
1.78 gchar *endptr;
1.79 unsigned int val = strtoul( text, &endptr, 16 );
1.80 if( text == endptr ) { /* invalid input */
1.81 char buf[10];
1.82 - sprintf( buf, "%08X", disasm_from );
1.83 + sprintf( buf, "%08X", row_to_address(data,0) );
1.84 gtk_entry_set_text( GTK_ENTRY(widget), buf );
1.85 } else {
1.86 - set_disassembly_region(val);
1.87 + set_disassembly_region(data, val);
1.88 }
1.89 }
1.90 return FALSE;
1.91 @@ -260,7 +264,8 @@
1.92 gtk_clist_get_text( clist, row, 1, &val );
1.93 if( val[0] != '\0' ) {
1.94 int addr = strtoul( val, NULL, 16 );
1.95 - jump_to_disassembly( addr, TRUE );
1.96 + debug_info_t data = get_debug_info( GTK_WIDGET(clist) );
1.97 + jump_to_disassembly( data, addr, TRUE );
1.98 }
1.99 }
1.100 }
1.101 @@ -270,7 +275,8 @@
1.102 on_jump_pc_btn_clicked (GtkButton *button,
1.103 gpointer user_data)
1.104 {
1.105 - jump_to_disassembly( sh4r.pc, TRUE );
1.106 + debug_info_t data = get_debug_info( GTK_WIDGET(button) );
1.107 + jump_to_pc( data, TRUE );
1.108 }
1.109
1.110
.