This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 4/4] gdb: After inferior call, finish all threads in process
- From: Pedro Alves <palves at redhat dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>, gdb-patches at sourceware dot org
- Date: Mon, 11 Jun 2018 19:13:35 +0100
- Subject: Re: [PATCH 4/4] gdb: After inferior call, finish all threads in process
- References: <cover.1527157948.git.andrew.burgess@embecosm.com> <652d28f3e550ca9080e9d4dc487bd8fe2c8a6478.1527157948.git.andrew.burgess@embecosm.com>
On 05/24/2018 11:50 AM, Andrew Burgess wrote:
> diff --git a/gdb/infcall.c b/gdb/infcall.c
> index b13f5b61d96..b33123d6c75 100644
> --- a/gdb/infcall.c
> +++ b/gdb/infcall.c
> @@ -658,7 +658,7 @@ run_inferior_call (struct call_thread_fsm *sm,
> if (!was_running
> && ptid_equal (call_thread_ptid, inferior_ptid)
> && stop_stack_dummy == STOP_STACK_DUMMY)
> - finish_thread_state (user_visible_resume_ptid (0));
> + finish_thread_state (pid_to_ptid (ptid_get_pid (inferior_ptid)));
I have to leave for now, so I have to admit to not having thought
through this one fully, but off hand this doesn't look right, so
I thought I'd send this quick comment anyway.
E.g., if in non-stop mode, that "finishes" all threads of the process, while
some thread may be user-visibly running but internally suspended waiting
for its turn in the displaced stepping queue, for example?
And what if "set schedule-multiple on" is in effect? Then more than
one process will have been resumed, but this only finishes the one
process?
I'll have to think about the schedlock on + new threads thing too.
I've thought about that multiple times, but I never recall what
my previous conclusion was. :-P
Thanks,
Pedro Alves