OSDN Git Service

Provide more detailed traces of the event queue.
authorcagney <cagney>
Fri, 28 Apr 2000 06:13:46 +0000 (06:13 +0000)
committercagney <cagney>
Fri, 28 Apr 2000 06:13:46 +0000 (06:13 +0000)
sim/common/ChangeLog
sim/common/sim-events.c

index bc0e35d..4346214 100644 (file)
@@ -1,3 +1,8 @@
+Wed Apr 26 16:18:44 2000  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * sim-events.c (update_time_from_event): Add more detailed event
+       tracing.
+
 2000-03-30  Dave Brolley  <brolley@redhat.com>
 
        * aclocal.m4 (cgen): Use guile to run cgen.
index 4b7d9b4..fa294a7 100644 (file)
 
 #include <signal.h> /* For SIGPROCMASK et.al. */
 
-#if __CYGWIN32__
-/* The ui_loop_hook is called to keep the GUI alive while the simulator
-   is running.  The counter is to make sure we do not wake it too often.
-*/
-
-extern void (*ui_loop_hook) PARAMS ((int));
-static unsigned int ui_loop_hook_counter = 0;
-#endif
-
 typedef enum {
   watch_invalid,
 
@@ -404,6 +395,27 @@ update_time_from_event (SIM_DESC sd)
       events->time_of_event = current_time - 1;
       events->time_from_event = -1;
     }
+  if (ETRACE_P)
+    {
+      sim_event *event;
+      int i;
+      for (event = events->queue, i = 0;
+          event != NULL;
+          event = event->next, i++)
+       {
+         ETRACE ((_ETRACE,
+                  "event time-from-event - time %ld, delta %ld - event %d, tag 0x%lx, time %ld, handler 0x%lx, data 0x%lx%s%s\n",
+                  (long)current_time,
+                  (long)events->time_from_event,
+                  i,
+                  (long)event,
+                  (long)event->time_of_event,
+                  (long)event->handler,
+                  (long)event->data,
+                  (event->trace != NULL) ? ", " : "",
+                  (event->trace != NULL) ? event->trace : ""));
+       }
+    }
   SIM_ASSERT (current_time == sim_events_time (sd));
 }
 
@@ -1171,18 +1183,6 @@ sim_events_process (SIM_DESC sd)
 
   /* this round of processing complete */
   events->nr_ticks_to_process = 0;
-
-#if __CYGWIN32__
-  /* Now call the ui_loop_hook to give the gui a chance to
-     process events. */
-  
-  if (ui_loop_hook != NULL)
-    {
-      /* attempt to limit calls to 1-10 per second */
-      if (! (ui_loop_hook_counter++ & 0xf))
-       (*ui_loop_hook) (-2); /* magic */
-    }
-#endif
 }
 
 #endif