forked from Imagelibrary/binutils-gdb
gdb: Run INF_EXEC_COMPLETE handler for additional cases
When making an inferior call, and non-stop mode is off, then, once the
inferior call is complete all threads will be stopped, and we should
run the INF_EXEC_COMPLETE handler. This will result in a call to
'target_async(0)' to remove the event handlers for the target.
This was discussed by Yao Qi in this mailing list thread:
https://sourceware.org/ml/gdb/2017-10/msg00032.html
Without this then the target event handlers are left in place even
when the target is stopped, which is different to what happens during
a standard stop proceedure (for example when one thread hits a
breakpoint).
gdb/ChangeLog:
PR gdb/22882
* infrun.c (fetch_inferior_event): If GDB is not proceeding then
run INF_EXEC_COMPLETE handler, even when not calling normal_stop.
Move should_notify_stop local into more inner scope.
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2018-06-12 Andrew Burgess <andrew.burgess@embecosm.com>
|
||||||
|
Stephen Roberts <stephen.roberts@arm.com>
|
||||||
|
|
||||||
|
PR gdb/22882
|
||||||
|
* infrun.c (fetch_inferior_event): If GDB is not proceeding then
|
||||||
|
run INF_EXEC_COMPLETE handler, even when not calling normal_stop.
|
||||||
|
Move should_notify_stop local into more inner scope.
|
||||||
|
|
||||||
2018-06-12 Andrew Burgess <andrew.burgess@embecosm.com>
|
2018-06-12 Andrew Burgess <andrew.burgess@embecosm.com>
|
||||||
Stephen Roberts <stephen.roberts@arm.com>
|
Stephen Roberts <stephen.roberts@arm.com>
|
||||||
|
|
||||||
|
|||||||
16
gdb/infrun.c
16
gdb/infrun.c
@@ -3932,7 +3932,6 @@ fetch_inferior_event (void *client_data)
|
|||||||
struct inferior *inf = find_inferior_ptid (ecs->ptid);
|
struct inferior *inf = find_inferior_ptid (ecs->ptid);
|
||||||
int should_stop = 1;
|
int should_stop = 1;
|
||||||
struct thread_info *thr = ecs->event_thread;
|
struct thread_info *thr = ecs->event_thread;
|
||||||
int should_notify_stop = 1;
|
|
||||||
|
|
||||||
delete_just_stopped_threads_infrun_breakpoints ();
|
delete_just_stopped_threads_infrun_breakpoints ();
|
||||||
|
|
||||||
@@ -3950,6 +3949,9 @@ fetch_inferior_event (void *client_data)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
int should_notify_stop = 1;
|
||||||
|
int proceeded = 0;
|
||||||
|
|
||||||
clean_up_just_stopped_threads_fsms (ecs);
|
clean_up_just_stopped_threads_fsms (ecs);
|
||||||
|
|
||||||
if (thr != NULL && thr->thread_fsm != NULL)
|
if (thr != NULL && thr->thread_fsm != NULL)
|
||||||
@@ -3960,17 +3962,15 @@ fetch_inferior_event (void *client_data)
|
|||||||
|
|
||||||
if (should_notify_stop)
|
if (should_notify_stop)
|
||||||
{
|
{
|
||||||
int proceeded = 0;
|
|
||||||
|
|
||||||
/* We may not find an inferior if this was a process exit. */
|
/* We may not find an inferior if this was a process exit. */
|
||||||
if (inf == NULL || inf->control.stop_soon == NO_STOP_QUIETLY)
|
if (inf == NULL || inf->control.stop_soon == NO_STOP_QUIETLY)
|
||||||
proceeded = normal_stop ();
|
proceeded = normal_stop ();
|
||||||
|
}
|
||||||
|
|
||||||
if (!proceeded)
|
if (!proceeded)
|
||||||
{
|
{
|
||||||
inferior_event_handler (INF_EXEC_COMPLETE, NULL);
|
inferior_event_handler (INF_EXEC_COMPLETE, NULL);
|
||||||
cmd_done = 1;
|
cmd_done = 1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user