From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17252 invoked by alias); 22 May 2013 18:21:57 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 17217 invoked by uid 89); 22 May 2013 18:21:52 -0000 X-Spam-SWARE-Status: No, score=-5.8 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.1 Received: from hop-nat-141.emc.com (HELO mexforward.lss.emc.com) (168.159.213.141) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 22 May 2013 18:21:51 +0000 Received: from hop04-l1d11-si02.isus.emc.com (HOP04-L1D11-SI02.isus.emc.com [10.254.111.55]) by mexforward.lss.emc.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id r4MILkHQ010492 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 22 May 2013 14:21:46 -0400 Received: from mailhub.lss.emc.com (mailhubhoprd02.lss.emc.com [10.254.221.253]) by hop04-l1d11-si02.isus.emc.com (RSA Interceptor); Wed, 22 May 2013 14:21:37 -0400 Received: from usendtaylorx2l.lss.emc.com (usendtaylorx2l.lss.emc.com [10.243.10.188]) by mailhub.lss.emc.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id r4MILbXm014992; Wed, 22 May 2013 14:21:37 -0400 Received: by usendtaylorx2l.lss.emc.com (Postfix, from userid 26043) id 2488B5B0261; Wed, 22 May 2013 14:21:35 -0400 (EDT) Received: from usendtaylorx2l (localhost [127.0.0.1]) by usendtaylorx2l.lss.emc.com (Postfix) with ESMTP id 90E065B0256; Wed, 22 May 2013 14:21:35 -0400 (EDT) To: Tom Tromey cc: "gdb@sourceware.org" Subject: Re: add-inferior / clone-inferior In-reply-to: <87ehczhy0c.fsf@fleche.redhat.com> References: <7249.1369061005@usendtaylorx2l> <87bo84l5ad.fsf@fleche.redhat.com> <87ehczhy0c.fsf@fleche.redhat.com> Comments: In-reply-to Tom Tromey message dated "Wed, 22 May 2013 10:47:47 -0400." Date: Wed, 22 May 2013 18:21:00 -0000 Message-ID: <8702.1369246895@usendtaylorx2l> From: David Taylor X-EMM-MHVC: 1 X-SW-Source: 2013-05/txt/msg00100.txt.bz2 Tom Tromey wrote: > Tom> The whole target stack needs to be switched out depending on which > Tom> target is "active". I guess one idea would be to make it depend on the > Tom> current inferior. But then I would worry whether the correct inferior > Tom> is always selected when gdb is doing various operations. > > Thinking about it some more, it may be simpler to associate the target > stack with a program space, not an inferior. This will have the same > effect, but I think gdb is generally more careful about selecting a > program space before doing an operation. E.g., linespec already does > this properly, breakpoints already do this properly, etc. > > Tom> I wonder if there are other UI issues to consider. > > One that comes to mind is what target is associated with an inferior > created with add-inferior? How could you change this inferior's target > to connect it to some existing target? Perhaps I misunderstand the question. Initially, there is just a dummy target. Do a command like 'file' and you have an exec target. Do a command like 'run' or 'attach' or 'target remote' or 'target extended-remote' and your process stratum target is pushed on top of the old file stratum target. Do a command like 'kill' or 'detach' and your process stratum target is popped and you are back at the exec stratum target -- the exec file -- at the top of your target stack. > Also, some way to see the active targets would be needed. "info target" > already seems to be taken. > > Tom Two needs I see: . you're trying to reuse a target that is currently in use and does not support concurrent use by multiple inferiors. When asking, as now, whether to kill the other use, just include the inferior ID if it is different than the current inferior. If the question caught the user by surprise, then he/she has been given the information needed to investigate and make an informed decision. . you want to know the full set of inferiors and their targets. Seems somewhat esoteric. Perhaps a maint command would be appropriate? Say, maint inferiors targets Giving as output the inferior id and the list of to_shortname values for the targets within its target stack?