aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2000-04-28 06:02:51 +0000
committerAndrew Cagney <cagney@redhat.com>2000-04-28 06:02:51 +0000
commit0c22be818ba91eba45f8930752fb7dada13c9f78 (patch)
tree9a7446e793d44df75413ad4432f955cc5b0efeef /sim
parent25d704f304309dd7585e734823d43071a6c558e5 (diff)
downloadgdb-0c22be818ba91eba45f8930752fb7dada13c9f78.zip
gdb-0c22be818ba91eba45f8930752fb7dada13c9f78.tar.gz
gdb-0c22be818ba91eba45f8930752fb7dada13c9f78.tar.bz2
Fix event insertion when processing more than one event for the current time.
Diffstat (limited to 'sim')
-rw-r--r--sim/ppc/ChangeLog7
-rw-r--r--sim/ppc/events.c8
2 files changed, 12 insertions, 3 deletions
diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
index 36bb656..e182234 100644
--- a/sim/ppc/ChangeLog
+++ b/sim/ppc/ChangeLog
@@ -1,3 +1,10 @@
+Fri Apr 28 15:59:27 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * events.c (event_queue_process): Call update_time_from_event
+ every time an event is removed from the queue.
+ (update_time_from_event): Delete assertion that a negative
+ time_from_event implies an empty event queue.
+
Fri Apr 28 15:53:54 2000 Andrew Cagney <cagney@b1.cygnus.com>
* interrupts.c (deliver_hardware_interrupt): Print time trace in
diff --git a/sim/ppc/events.c b/sim/ppc/events.c
index 5743ffd..72c9138 100644
--- a/sim/ppc/events.c
+++ b/sim/ppc/events.c
@@ -180,7 +180,6 @@ update_time_from_event(event_queue *events)
}
}
ASSERT(current_time == event_queue_time(events));
- ASSERT((events->time_from_event >= 0) == (events->queue != NULL));
}
STATIC_INLINE_EVENTS\
@@ -394,12 +393,15 @@ event_queue_process(event_queue *events)
(long)handler,
(long)data));
zfree(to_do);
+ /* Always re-compute the time to the next event so that HANDLER()
+ can safely insert new events into the queue. */
+ update_time_from_event(events);
handler(data);
}
events->processing = 0;
- /* re-caculate time for new events */
- update_time_from_event(events);
+ ASSERT(events->time_from_event > 0);
+ ASSERT(events->queue != NULL); /* always poll event */
}