This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Delete program spaces directly when removing inferiors
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: Pedro Alves <palves at redhat dot com>, <gdb-patches at sourceware dot org>
- Date: Wed, 8 Jul 2015 14:40:09 -0400
- Subject: Re: [PATCH] Delete program spaces directly when removing inferiors
- Authentication-results: sourceware.org; auth=none
- References: <1412022790-21931-1-git-send-email-simon dot marchi at ericsson dot com> <559D1220 dot 1060708 at redhat dot com> <559D4314 dot 2000906 at ericsson dot com> <559D44FF dot 60705 at ericsson dot com> <559D48CE dot 5030700 at redhat dot com> <559D6784 dot 9080408 at ericsson dot com> <559D6935 dot 7060103 at redhat dot com>
On 15-07-08 02:17 PM, Pedro Alves wrote:
> Hmm, I think it'll fix a bug, actually. There should always
> be an inferior. And that deletes it. So I assume
> that after closing the monitor target, GDB crashes as soon as
> it refers to the current inferior...
>
> In the original multi-process support (~7.0), that was not the
> case -- if you were not debugging a process, there's be
> no inferior. Seems like this code has bit rotten.
Ok, I had this intuition as well (about deleting the last inferior).
> I guess this suggests that no one's been using these monitor
> targets for a long while?
Or they don't mind/notice that it crashes at exit.
>>
>> Is there any way to test that code path relatively easily on x86?
>>
>
> Don't think so. You could stick a:
>
> delete_inferior_silent (ptid_get_pid (monitor_ptid));
>
> call in remote.c:remote_close and see what happens there though.
I tried something similar (monitor_ptid is not available there), and
bad things happen indeed.
I'll try to update my patch to use discard_all_inferiors, but it will
be a "theoretical" fix, since there's no way to test.
Thanks!