This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFA]: Fix delete_hw_event_data() to free the scheduled events
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [RFA]: Fix delete_hw_event_data() to free the scheduled events
- From: Stephane Carrez <Stephane dot Carrez at worldnet dot fr>
- Date: Sun, 26 Nov 2000 22:58:19 +0100
Hi!
When a hardware device is deleted with hw_delete(), if it has some scheduled
events, the simulator aborts. The problem is that delete_hw_event_data()
does nothing but aborts if some events are scheduled. The patch fixes that.
Can you approve this patch?
Stephane
2000-11-26 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* hw-events.c (delete_hw_event_data): Remove the scheduled events.
Index: hw-events.c
===================================================================
RCS file: /cvs/src/src/sim/common/hw-events.c,v
retrieving revision 1.2
diff -p -r1.2 hw-events.c
*** hw-events.c 2000/07/27 11:37:34 1.2
--- hw-events.c 2000/11/26 20:55:28
*************** create_hw_event_data (struct hw *me)
*** 51,58 ****
void
delete_hw_event_data (struct hw *me)
{
! if (me->events_of_hw != NULL)
! hw_abort (me, "stray events");
}
--- 51,59 ----
void
delete_hw_event_data (struct hw *me)
{
! /* Remove the scheduled event. */
! while (me->events_of_hw)
! hw_event_queue_deschedule (me, &me->events_of_hw->event);
}