]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* gdbtk.c (gdbtk_wait): Don't run the timer for ice targets.
authorKeith Seitz <keiths@cygnus>
Fri, 25 Sep 1998 15:22:23 +0000 (15:22 +0000)
committerKeith Seitz <keiths@cygnus>
Fri, 25 Sep 1998 15:22:23 +0000 (15:22 +0000)
        * 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.

gdb/ChangeLog-gdbtk
gdb/gdbtk-hooks.c
gdb/v850ice.c

index bed4b846c41f0bc9c0db77ef9dd1b0b6f8460f6d..f629f37acc490e47bd2f7648abbd6d82801d7d7c 100644 (file)
@@ -1,3 +1,15 @@
+1998-09-24  Keith Seitz  <keiths@cygnus.com>
+
+       * 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.
+
 start-sanitize-ide
 Mon Sep 21 13:33:27 1998  Drew Moseley  <dmoseley@cygnus.com>
 
index 8f6f19c3e5583ddc60535bbdb97c6b15ac42c6b4..ff2e7f51d90dc85efae6d6cf939ea25be30fe361 100644 (file)
@@ -593,7 +593,9 @@ gdbtk_wait (pid, ourstatus)
      int pid;
      struct target_waitstatus *ourstatus;
 {
-  gdbtk_start_timer ();
+  /* Don't run the timer on various targets... */
+  if (!STREQ (target_shortname, "ice"))
+    gdbtk_start_timer ();
   pid = target_wait (pid, ourstatus);
   gdbtk_stop_timer ();
   return pid;
index b8d32013fd056ad08c4691876deccc24fa01f41c..bbf5b9e41c276d251b94f465376c706fc23f4351 100755 (executable)
@@ -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)