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: Pedro Alves <palves at redhat dot com>
- To: Simon Marchi <simon dot marchi at ericsson dot com>, gdb-patches at sourceware dot org
- Date: Wed, 08 Jul 2015 19:17:25 +0100
- 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>
On 07/08/2015 07:10 PM, Simon Marchi wrote:
> On 15-07-08 11:59 AM, Pedro Alves wrote:
>>
>> Yeah, it's only built if you build support for a target that pulls it in.
>> See configure.tgt, look for monitor.o. The buildbot uses --enable-targets=all,
>> you probably didn't.
>
> Oh right, I'll build with --enable-targets=all consistently from now on.
>
>> We can probably just make monitor.c call discard_all_inferiors.
>
> This doesn't have the same effect though. discard_all_inferiors
> does not delete the inferior, it just makes them exit. I am not
> sure what difference it will make.
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.
I guess this suggests that no one's been using these monitor
targets for a long while?
>
> 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.
Thanks,
Pedro Alves