Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: Vladimir Prus <vladimir@codesourcery.com>
Cc: gdb-patches@sourceware.org,  Eli Zaretskii <eliz@gnu.org>,
	 Marc Khouzam <marc.khouzam@ericsson.com>
Subject: Re: [v4 2/2] multi-executable support (new v5 patch included)
Date: Wed, 09 Sep 2009 10:28:00 -0000	[thread overview]
Message-ID: <200909091128.19953.pedro@codesourcery.com> (raw)
In-Reply-To: <200909091040.23991.vladimir@codesourcery.com>

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    <null>            goodbye
  * 1    <null>            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&
 <breakpoint 1 hit, inferior 1>
 <breakpoint 2 hit, inferior 2>

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


  reply	other threads:[~2009-09-09 10:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-03  2:49 [v4 0/2] multi-executable support Pedro Alves
2009-09-03  2:51 ` [v4 1/2] " Pedro Alves
2009-09-03  2:53 ` [v4 2/2] " Pedro Alves
2009-09-03 18:31   ` Eli Zaretskii
2009-09-03 18:40     ` Pedro Alves
2009-09-03 20:37       ` Eli Zaretskii
2009-09-05 18:41     ` Pedro Alves
2009-09-05 20:16       ` Eli Zaretskii
2009-09-05 21:15         ` Pedro Alves
2009-09-06  3:16           ` Eli Zaretskii
2009-09-08 15:16             ` [v4 2/2] multi-executable support (new v5 patch included) Pedro Alves
2009-09-08 19:16               ` Eli Zaretskii
2009-10-05 15:22                 ` Pedro Alves
2009-09-09  6:40               ` Vladimir Prus
2009-09-09 10:28                 ` Pedro Alves [this message]
2009-09-03  2:56 ` [v4 0/2] multi-executable support (.gz) Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200909091128.19953.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=marc.khouzam@ericsson.com \
    --cc=vladimir@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox