From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28059 invoked by alias); 9 Sep 2009 10:28:26 -0000 Received: (qmail 27945 invoked by uid 22791); 9 Sep 2009 10:28:24 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Sep 2009 10:28:16 +0000 Received: (qmail 21643 invoked from network); 9 Sep 2009 10:28:15 -0000 Received: from unknown (HELO orlando) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 9 Sep 2009 10:28:15 -0000 From: Pedro Alves To: Vladimir Prus Subject: Re: [v4 2/2] multi-executable support (new v5 patch included) Date: Wed, 09 Sep 2009 10:28:00 -0000 User-Agent: KMail/1.9.10 Cc: gdb-patches@sourceware.org, Eli Zaretskii , Marc Khouzam References: <200909030349.38319.pedro@codesourcery.com> <200909081616.18200.pedro@codesourcery.com> <200909091040.23991.vladimir@codesourcery.com> In-Reply-To: <200909091040.23991.vladimir@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909091128.19953.pedro@codesourcery.com> X-IsSubscribed: yes 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 X-SW-Source: 2009-09/txt/msg00239.txt.bz2 On Wednesday 09 September 2009 07:40:23, Vladimir Prus wrote: > On Tuesday 08 September 2009 Pedro Alves wrote: > > I've tweaked things around so that MI's thread-groups are > > created at the same time as before, but obviously, MI needs to > > be extended to be able to support multi-exec + multi-inferiors > > properly. > > What do you mean precisely. I have no comment about the above behaviour > in CLI, but I think that for MI it is important that the 'thread-group-created' > notification is emitted only when you have "real" inferiour that frontend > can interact with, and not some "fake" one that is associated with a > file but is otherwise dead. You need to load symbols before starting the inferior to be able to set breakpoints before running it. On DICOS, you didn't have to think about it, because all symbols were common to all inferiors. On linux you do, every inferior needs to have its own set of symbols. > Also, what is exactly requires to support multi-exec/multi-inferiours? Load multiple executables into the debug session, and be able to have commands apply to them. I'll give a couple examples below. > Is there any reason why thread groups are not sufficient to represent this? If you want to do two -exec-run's in the same session, how do you specify which executable this is going to run? That is, how do you translate this to MI? gdb hello ... (gdb) break hello_main breakpoint 1 added. (gdb) add-inferior -exec goodbye Inferior 2 added. (gdb) info inferiors Num Description Executable 2 goodbye * 1 hello (gdb) inferior 2 Switched to inferior 2. (gdb) break goodbye_main breakpoint 2 added. (gdb) inferior 1 (gdb) run& (gdb) inferior 2 (gdb) run& Extending -exec-run to include an optional executable argument works mostly, but it is not sufficient. You need to be able to load multiple executables, and to be able to switch scope between them, not just for breakpoints, watchpoints, etc., but for anything that can be possible to do currently without a running inferior that reads symbols or memory from the executable. Another thing that needs extending is shared libraries support. Again, on DICOS we didn't have to think about this, since the shared library list was global to all inferiors, but, on linux, what does this mean? =library-loaded,id="/usr/lib/libfoo.so.2",target-name="/usr/lib/libfoo.so.2",host-name="/usr/lib/libfoo.so.2",symbols-loaded="0" Which inferior loaded this library? A related question is then, how to list the shared libraries of a given inferior? -- Pedro Alves