aboutsummaryrefslogtreecommitdiff
path: root/gdb/v850ice.c
diff options
context:
space:
mode:
authorKeith Seitz <keiths@cygnus>1998-09-25 15:22:23 +0000
committerKeith Seitz <keiths@cygnus>1998-09-25 15:22:23 +0000
commit4ce8d0e977321d1df165590fdd885a0ca5961191 (patch)
tree01078f2b8ce5680423c1bafdd00f0fbf1d4ed567 /gdb/v850ice.c
parent4817b40893ad3836543d8254269860687578dd3d (diff)
downloadgdb-4ce8d0e977321d1df165590fdd885a0ca5961191.zip
gdb-4ce8d0e977321d1df165590fdd885a0ca5961191.tar.gz
gdb-4ce8d0e977321d1df165590fdd885a0ca5961191.tar.bz2
* gdbtk.c (gdbtk_wait): Don't run the timer for ice targets.
* v850ice.c (WM_ADDR_TO_SYM): New message. (v850ice_wndproc): Add handler for WM_SOURCE. (v850ice_wait): Call the ui_loop_hook occasionally. (ice_cont): Acknowledge message before doing anything. (ice_stepi): Ack message and let gdbtk do stepping. (ice_nexti): Ack message and let gdbtk do stepping. (view_source): New function ICE calls to display source code.
Diffstat (limited to 'gdb/v850ice.c')
-rwxr-xr-xgdb/v850ice.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/gdb/v850ice.c b/gdb/v850ice.c
index b8d3201..bbf5b9e 100755
--- a/gdb/v850ice.c
+++ b/gdb/v850ice.c
@@ -56,6 +56,8 @@ extern void continue_command PARAMS ((char *, int));
extern HINSTANCE Tk_GetHINSTANCE PARAMS ((void));
+extern void (*ui_loop_hook) PARAMS ((int));
+
/* Prototypes for local functions */
static int init_hidden_window PARAMS ((void));
@@ -120,6 +122,8 @@ static int ice_nexti PARAMS ((char *));
static void togdb_force_update PARAMS ((void));
+static void view_source PARAMS ((CORE_ADDR));
+
/* Globals */
static HWND hidden_hwnd; /* HWND for messages */
@@ -173,6 +177,7 @@ static int SimulateCallback; /* simulate a callback event */
#define WM_SYM_TO_ADDR WM_USER+102
#define WM_ADDR_TO_SYM WM_USER+103
#define WM_DISASSEMBLY WM_USER+104
+#define WM_SOURCE WM_USER+105
/* STATE_CHANGE codes */
#define STATE_CHANGE_REGS 1 /* Register(s) changed */
@@ -253,6 +258,9 @@ v850ice_wndproc (hwnd, message, wParam, lParam)
case WM_ADDR_TO_SYM:
MessageBox (0, "Address resolution\nNot implemented", "GDB", MB_OK);
break;
+ case WM_SOURCE:
+ view_source ((CORE_ADDR) lParam);
+ break;
case WM_STATE_CHANGE:
switch (wParam)
{
@@ -442,11 +450,19 @@ v850ice_wait (pid, status)
char buf[256];
struct MessageIO iob;
int done = 0;
+ int count = 0;
+
iob.size = 0;
iob.buf = buf;
do
{
+ if (count++ % 100000)
+ {
+ ui_loop_hook (-2);
+ count = 0;
+ }
+
v850_status = ExeAppReq ("GDB", GCHECKSTATUS, NULL, &iob);
switch (v850_status)
@@ -822,6 +838,7 @@ ice_cont (c)
char *c;
{
printf_filtered ("continue (ice)");
+ ReplyMessage ((LRESULT) 1);
Tcl_Eval (gdbtk_interp, "gdb_immediate continue");
return 1;
}
@@ -835,8 +852,8 @@ ice_stepi (c)
sprintf (string, "gdb_immediate stepi %d", count);
printf_unfiltered ("stepi (ice)\n");
- Tcl_Eval (gdbtk_interp, string);
ReplyMessage ((LRESULT) 1);
+ Tcl_Eval (gdbtk_interp, string);
return 1;
}
@@ -849,6 +866,7 @@ ice_nexti (c)
sprintf (string, "gdb_immediate nexti %d", count);
printf_unfiltered ("nexti (ice)\n");
+ ReplyMessage ((LRESULT) 1);
Tcl_Eval (gdbtk_interp, string);
return 1;
}
@@ -872,6 +890,16 @@ togdb_force_update (void)
Tcl_Eval (gdbtk_interp, "gdbtk_update");
}
+static void
+view_source (addr)
+ CORE_ADDR addr;
+{
+ char c[256];
+
+ sprintf (c, "set src [lindex [manage find src] 0]\n$src location [gdb_loc *0x%x]", addr);
+ Tcl_Eval (gdbtk_interp, c);
+}
+
/* Define the target subroutine names */
static void init_850ice_ops(void)