Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb@sourceware.org
Subject: Re: program spaces vs exec
Date: Thu, 06 Oct 2011 19:05:00 -0000	[thread overview]
Message-ID: <CADPb22RUztzR7UACRadzEfPGFYkr9TVqnwa5PeeyX_59068MVA@mail.gmail.com> (raw)
In-Reply-To: <201110061251.22983.pedro@codesourcery.com>

On Thu, Oct 6, 2011 at 4:51 AM, Pedro Alves <pedro@codesourcery.com> wrote:
>
> On Wednesday 05 October 2011 19:15:26, Doug Evans wrote:
> > Hi.
> >
> > Question: Why does the program space remain unchanged across an exec?
> > [for reference sake, target = amd64-linux]
> >
> > Is it just expediency?  Or is there a functional reason?
>
> That preserved better how gdb behaved before there were
> multiple program spaces.  E.g., breakpoints are supposed to reset/resolve
> after the exec, and since the breakpoint symbol search scope is
> currently tied to a program space, keeping the same program space
> keeps that working the same.  For exec, I don't have a strong
> feeling either way, we could say that there's a new address/program
> space attached to the inferior, or we could say that the inferior's
> address/program spaces have been refreshed with a new set of
> pages.  I chose the latter approach originally.

So it seems like it was more just an implementation decision than
something part of a design spec.
[just want to confirm I understood what you wrote correctly]

[...]

> > This concerns more than just exec of course.
> > E.g., Any time the "main" objfile is changed (e.g., "file foo") I'd intuitively
> > expect a new program space.
>
> Changing the main file does not necessarily invalidate or get rid of the
> loaded shared library list, so I think we should not create a new program
> space for this.

Huh.  Does that have a functional use (as distinct from, e.g., an
optimization-use)?
[in the context of amd64-linux, et.al.]
What if the new program uses a different ld.so?

btw, I'm still not sure our definitions of program spaces match, and I
think we need to fix that first.
According to previous emails from you, e.g. the one I mentioned,
"program space" == "symbol space".
Intuitively, if the symbol space is changed, then the program space is
changed as well by definition.
If I change the main program that, to me, changes the symbol space.
I gather this intuitive notion is incorrect.


  parent reply	other threads:[~2011-10-06 19:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-05 18:15 Doug Evans
2011-10-06 11:51 ` Pedro Alves
2011-10-06 18:23   ` Tom Tromey
2011-10-06 18:43     ` Pedro Alves
2011-10-06 19:32       ` Tom Tromey
2011-10-06 19:35       ` Tom Tromey
2011-10-06 19:41         ` Pedro Alves
2011-10-07 15:43           ` Tom Tromey
2011-10-09 20:42           ` Doug Evans
2011-10-06 19:05   ` Doug Evans [this message]
     [not found]   ` <CADPb22RCDS-a2FBm=Bf-W8j1X8CXatEFdZOpk1MAJyUHTvJvWA@mail.gmail.com>
2011-10-06 19:35     ` 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=CADPb22RUztzR7UACRadzEfPGFYkr9TVqnwa5PeeyX_59068MVA@mail.gmail.com \
    --to=dje@google.com \
    --cc=gdb@sourceware.org \
    --cc=pedro@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