extern HINSTANCE Tk_GetHINSTANCE PARAMS ((void));
+extern void (*ui_loop_hook) PARAMS ((int));
+
/* Prototypes for local functions */
static int init_hidden_window PARAMS ((void));
static void togdb_force_update PARAMS ((void));
+static void view_source PARAMS ((CORE_ADDR));
+
+static void do_gdb (char *, char *, int);
+
+
/* Globals */
static HWND hidden_hwnd; /* HWND for messages */
#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 */
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)
{
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)
char *c;
{
printf_filtered ("continue (ice)");
+ ReplyMessage ((LRESULT) 1);
Tcl_Eval (gdbtk_interp, "gdb_immediate continue");
return 1;
}
+static void
+do_gdb (cmd, str, count)
+ char *cmd;
+ char *str;
+ int count;
+{
+
+ ReplyMessage ((LRESULT) 1);
+
+ while (count--)
+ {
+ printf_unfiltered (str);
+ Tcl_Eval (gdbtk_interp, cmd);
+ }
+}
+
+
static int
ice_stepi (c)
char *c;
{
- char string[50] = "\0";
int count = (int) c;
- sprintf (string, "gdb_immediate stepi %d", count);
- printf_unfiltered ("stepi (ice)\n");
- Tcl_Eval (gdbtk_interp, string);
- ReplyMessage ((LRESULT) 1);
+ do_gdb ("gdb_immediate stepi", "stepi (ice)\n", count);
return 1;
}
ice_nexti (c)
char *c;
{
- char string[50] = "\0";
int count = (int) c;
- sprintf (string, "gdb_immediate nexti %d", count);
- printf_unfiltered ("nexti (ice)\n");
- Tcl_Eval (gdbtk_interp, string);
+ do_gdb ("gdb_immediate nexti", "nexti (ice)\n", count);
return 1;
}
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 BROWSE [gdb_loc *0x%x]", addr);
+ Tcl_Eval (gdbtk_interp, c);
+}
+
/* Define the target subroutine names */
static void init_850ice_ops(void)