From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16502 invoked by alias); 8 Jul 2015 18:40:16 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 16450 invoked by uid 89); 8 Jul 2015 18:40:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-HELO: usevmg20.ericsson.net Received: from usevmg20.ericsson.net (HELO usevmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 08 Jul 2015 18:40:12 +0000 Received: from EUSAAHC004.ericsson.se (Unknown_Domain [147.117.188.84]) by usevmg20.ericsson.net (Symantec Mail Security) with SMTP id 6D.5B.12958.8531D955; Wed, 8 Jul 2015 14:11:04 +0200 (CEST) Received: from [142.133.110.144] (147.117.188.8) by smtp-am.internal.ericsson.com (147.117.188.86) with Microsoft SMTP Server id 14.3.210.2; Wed, 8 Jul 2015 14:40:09 -0400 Message-ID: <559D6E89.5040709@ericsson.com> Date: Wed, 08 Jul 2015 18:40:00 -0000 From: Simon Marchi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Pedro Alves , Subject: Re: [PATCH] Delete program spaces directly when removing inferiors References: <1412022790-21931-1-git-send-email-simon.marchi@ericsson.com> <559D1220.1060708@redhat.com> <559D4314.2000906@ericsson.com> <559D44FF.60705@ericsson.com> <559D48CE.5030700@redhat.com> <559D6784.9080408@ericsson.com> <559D6935.7060103@redhat.com> In-Reply-To: <559D6935.7060103@redhat.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg00246.txt.bz2 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!