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 10:c898b37506e0
prev9:2784c7660165
next11:0a82ef380c45
author nkeynes
date Sun Dec 11 05:15:36 2005 +0000 (15 years ago)
permissions -rw-r--r--
last change Add CPU disasembly options to mode dropdown
Split sh4/mem.c into core mem.c and sh4/mem.c
Start adding copyright comments to file headers
file annotate diff log raw
1.1 --- a/src/gui/debug_win.c Thu Dec 08 13:38:00 2005 +0000
1.2 +++ b/src/gui/debug_win.c Sun Dec 11 05:15:36 2005 +0000
1.3 @@ -1,4 +1,19 @@
1.4 -
1.5 +/**
1.6 + * $Id: debug_win.c,v 1.4 2005-12-11 05:15:36 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 + *
1.11 + * This program is free software; you can redistribute it and/or modify
1.12 + * it under the terms of the GNU General Public License as published by
1.13 + * the Free Software Foundation; either version 2 of the License, or
1.14 + * (at your option) any later version.
1.15 + *
1.16 + * This program is distributed in the hope that it will be useful,
1.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.19 + * GNU General Public License for more details.
1.20 + */
1.21 #include <stdlib.h>
1.22 #include <stdarg.h>
1.23 #include <gnome.h>
1.24 @@ -57,7 +72,7 @@
1.25 appbar = gtk_object_get_data(GTK_OBJECT(win), "debug_appbar");
1.26 data->icounter = gnome_appbar_get_progress( appbar );
1.27 gtk_progress_bar_set_text(data->icounter, "1");
1.28 -
1.29 +
1.30 gtk_object_set_data( GTK_OBJECT(win), "debug_data", data );
1.31 return data;
1.32 }
1.33 @@ -127,7 +142,7 @@
1.34 for( i=from; i<to; ) {
1.35 i = data->cpu->disasm_func( i, buf, sizeof(buf) );
1.36 sprintf( addr, "%08X", i );
1.37 - op = mem_read_phys_word(i);
1.38 + op = sh4_read_phys_word(i);
1.39 sprintf( opcode, "%02X %02X", op&0xFF, op>>8 );
1.40 posn = gtk_clist_append( data->disasm_list, arr );
1.41 if( buf[0] == '?' )
1.42 @@ -181,6 +196,12 @@
1.43 data->disasm_pc = pc;
1.44 }
1.45
1.46 +void set_disassembly_cpu( debug_info_t data, char *cpu )
1.47 +{
1.48 +
1.49 +
1.50 +}
1.51 +
1.52 uint32_t row_to_address( debug_info_t data, int row ) {
1.53 return data->cpu->instr_size * row + data->disasm_from;
1.54 }
1.55 @@ -191,6 +212,7 @@
1.56 return (address - data->disasm_from) / data->cpu->instr_size;
1.57 }
1.58
1.59 +
1.60 void emit( void *ptr, int level, int source, char *msg, ... )
1.61 {
1.62 char buf[20], addr[10] = "", *p;
.