From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25547 invoked by alias); 20 May 2013 15:06:23 -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 25537 invoked by uid 89); 20 May 2013 15:06:23 -0000 X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=ham version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 20 May 2013 15:06:22 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1UeRfI-0005Mv-Q7 from Luis_Gustavo@mentor.com ; Mon, 20 May 2013 08:06:20 -0700 Received: from NA1-MAIL.mgc.mentorg.com ([147.34.98.181]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 20 May 2013 08:06:20 -0700 Received: from [172.30.64.161] ([172.30.64.161]) by NA1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 20 May 2013 08:06:19 -0700 Message-ID: <519A3BE7.6010004@codesourcery.com> Date: Mon, 20 May 2013 15:06:00 -0000 From: Luis Machado Reply-To: lgustavo@codesourcery.com User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: David Taylor CC: gdb@sourceware.org Subject: Re: add-inferior / clone-inferior References: <7249.1369061005@usendtaylorx2l> In-Reply-To: <7249.1369061005@usendtaylorx2l> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2013-05/txt/msg00083.txt.bz2 On 05/20/2013 04:43 PM, David Taylor wrote: > The commands add-inferior / clone-inferior and several related commands > were added as long ago as gdb 7.1. But, unless I'm missing the obvious, > they aren't currently very useful. > > GDB appears to support multiple "live" inferiors only when the arise as > the result of a fork or vfork. Please tell me that I'm wrong and that > I'm missing the obvious. > > . I start up gdb with no arguments > . file my-elf-file > . clone-inferior > . info inferiors > > I now have two inferiors, numbers 1 and 2, same elf file; 1 is curent. > > . target remote > . inferior 2 > . target remote > > And I get: > > A program is being debugged already. Kill it? (y or n) This is expected since you can actually have two inferiors, but you are only allowed to connect to a single remote target at one time. What would've worked is first connecting to a remote target in *extended* remote mode. Then you would be able to attach to more than a process at a time, or start more than a process at a time. By using "target remote", you're really trying to debug an already active process running on a remote system. I'd suggest reading about the extended remote mode. That looks like what you want, though multiprocess support is still a WIP.