From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31236 invoked by alias); 8 Apr 2011 10:00:55 -0000 Received: (qmail 31222 invoked by uid 22791); 8 Apr 2011 10:00:54 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 08 Apr 2011 10:00:48 +0000 Received: (qmail 8181 invoked from network); 8 Apr 2011 10:00:48 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 8 Apr 2011 10:00:48 -0000 From: Pedro Alves To: Kevin Pouget Subject: Re: Multiple remote inferiors Date: Fri, 08 Apr 2011 10:00:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-28-generic; KDE/4.6.2; x86_64; ; ) Cc: gdb@sourceware.org References: <201104062029.52921.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201104081100.45334.pedro@codesourcery.com> X-IsSubscribed: yes 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 X-SW-Source: 2011-04/txt/msg00023.txt.bz2 On Friday 08 April 2011 10:40:44, Kevin Pouget wrote: > Hi Pedro, > > thanks for your answer, I gave it a try, but it seems to behave a bit strangely. Hmm, yes, I can see how you've hit something confusing. > > --> should it be possible to start _two different_ processes from a single GDBServer ? Yes. > > here is what I got (debugging functionPtr and stackoverflow): > > $ gdbserver :1234 functionPtr This sets the default process to launch as "functionPtr". > Process functionPtr created; pid = 10820 > Listening on port 1234 > Remote debugging from host 127.0.0.1 > Process functionPtr created; pid = 10825 > > $ gdb functionPtr > GNU gdb (GDB) Fedora (7.2-46.fc14) > ... > Reading symbols from /home/kevin/travail/arm/perso/root/sample/debug/functionPtr...done. > (gdb) target extended-remote :1234 > Remote debugging using :1234 > ... > (gdb) b main > Breakpoint 1 at 0x400533: file ./functionPtr.c, line 8. > (gdb) c > Continuing. > Breakpoint 1, main () at ./functionPtr.c:8 > 8 void (* my_say) (const char *) = NULL ; > > (gdb) add-inferior > Added inferior 2 > (gdb) inferior 2 > [Switching to inferior 2 [Thread 0.0] ()] > (gdb) file stackoverflow > Reading symbols from /home/kevin/travail/arm/perso/root/sample/debug/stackoverflow...done. There is no automatic connection between GDB's executable, and the executable gdbserver spawns. You also need to do "set remote exec-file FOO" I was assuming you'd start gdbserver with --multi, like so: $ gdbserver --multi :9999 Which would have forced you to use that command at least once and make the problem more obvious. > (gdb) b main > Breakpoint 2 at 0x400522: file stackoverflow.c, line 10. > (gdb) r > Starting program: /home/kevin/travail/arm/perso/root/sample/debug/stackoverflow > Ignoring packet error, continuing... This shouldn't happen. Is it a red herring? > but ultimately, what I would like to do is connecting GDB to two *different* gdbservers, ie maintain two TCP connections simultaneously. A lot to do to get there, but the good thing is that we're closer that ever. :-) -- Pedro Alves