From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4952 invoked by alias); 15 May 2013 15:33:42 -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 4916 invoked by uid 89); 15 May 2013 15:33:42 -0000 X-Spam-SWARE-Status: No, score=-8.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 15 May 2013 15:33:41 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4FFXc01019883 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 15 May 2013 11:33:38 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r4FFXaug024219; Wed, 15 May 2013 11:33:37 -0400 Message-ID: <5193AAD0.1030808@redhat.com> Date: Wed, 15 May 2013 15:33:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 MIME-Version: 1.0 To: Yao Qi CC: gdb-patches@sourceware.org Subject: Re: [RFC] Don't create inferior in tfile target. References: <1367631071-20079-1-git-send-email-yao@codesourcery.com> In-Reply-To: <1367631071-20079-1-git-send-email-yao@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-05/txt/msg00536.txt.bz2 On 05/04/2013 02:31 AM, Yao Qi wrote: > In ctf target, we don't create inferior when open ctf trace file, > however we do it in tfile target. After read the code for a while, I > don't see any reason that we need an inferior here. The code was > added along with the tfile support patch, and was modified once by > patch [1] > > I checked out the code on the revision before patch [1] was applied > bd196e7a61b03f2ea7e5dcb0aecbd49d239d6390 and I am able to reproduce > the same internal error, However, I am wondering why do we need > inferior in tfile target. I removed the code to create inferior in > tfile_open and remove inferior in tfile_close. The internal error can > be fixed also. I also checked that 'info threads' and 'info > inferiors' works properly. > > I talked with Stan (he wrote tfile supported code) on this, but we were > unable to recall the reason in details on creating inferior. I post > this patch to remove the code to create inferior in tfile target. > Comments are welcome. I have a very vague recollection that it was I who suggested this in internal reviews at the time, but GDB was a bit different then, and I don't recall exactly why. It's possible you might find that in CS's archives. The whole tfile/tracepoints model is weird, in that it's hacked on, and bypasses the whole target stack model. You get things like, while inspecting a traceframe (on targets where threads are a kernel entity), "info threads" lists you the threads the live target happens to have at the moment. Same with shared libraries, etc. This could/should probably be revisited once gdb learns about being connected to multiple targets simultaneously. I was going to say this would break "detach" with tfile (detach_command checks for null_ptid). Except "detach" with tfile doesn't work already -- with target core, "detach" unloads the core, and I assumed tfile behaved the same. I think it'd be reasonable if it did. You didn't mention it explicitly, so I'll ask. There are probably more commands that treat null_ptid magically. Could you audit kill, detach, continue, step, etc. to see if they'll do something reasonable? Or rather, could you audit/grep the tree for null_ptid uses? E.g., I see that dcache.c uses null_ptid as magic number, but probably that doesn't matter for tfile. There don't seem to be that many checks for null_ptid, and many are in run control code, which obviously doesn't apply, so an audit seems doable. Thanks, -- Pedro Alves