The attached patch fixes a long-standing problem in thread-db.c: check_event(). When a create or death breakpoint is detected, the td_ta_event_getmsg() interface from libthread_db is used to get "a message" from the queue. This message does not necessarily match the breakpoint just reached. The td_ta_event_getmsg() interface has to be used because we don't the lwp that has been created. The change made is to loop through all available messages and process them. This ensures that the message set for the breakpoint is processed before continuing. This change allows death events to be enabled, if desired. Ok to commit? -- Jeff J. 2003-04-23 Jeff Johnston * thread-db.c (check_event): For create/death event breakpoints, loop through all messages to ensure that we read the message corresponding to the breakpoint we are at.