Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Daniel Jacobowitz <drow@false.org>,  Jacob Potter <jdpotter@google.com>
Subject: Re: [RFA] Use data cache for stack accesses
Date: Fri, 10 Jul 2009 09:34:00 -0000	[thread overview]
Message-ID: <200907101029.12135.pedro@codesourcery.com> (raw)
In-Reply-To: <200907082158.44386.pedro@codesourcery.com>

On Wednesday 08 July 2009 21:58:44, Pedro Alves wrote:
> On Wednesday 08 July 2009 21:51:40, Daniel Jacobowitz wrote:
> > Or could we store a dcache per-inferior?  Jacob's right - I thought
> > there was an 'inferior_data' to store arbitrary data per-inferior,
> > but there isn't.  

> > I don't like baking knowledge into other modules 
> > of GDB that they can extract the PID and use it to key per-inferior
> > data.
> > 
> > Or just add it to struct inferior?

To complete a thought: if not adding a generic inferior_data so that
modules can put whatever they want there, then putting a new member
on struct inferior exposes some module's internal detail to the rest
of GDB.  I'm not sure I like that better either.  Note that we
always get the inferior from the pid (it's mostly unavoidable, 
we need a way to map a target reported pid to an internal inferior).
Even current_inferior() does that.

> The reason I didn't suggest that is that we don't have an
> address space object --- yet.  My multi-exec patches add one, and
> there's a similar mechanism to per-objfile data where we can
> do things like these.  More than one inferior can share the
> same address space, 

Forgot to be explicit on a real, current, example of
this: debugging parent/child vforks.

> so we could share a cache between them, but,  
> if the cache if write-through, it won't be a big problem if we
> don't ---  it would be if it was left as writeback.
> 
> I don't have a problem with adding this to struct inferior for now,
> it just seemed premature.
> 

Actually, I think that if you make it per-inferior, and *don't flush it
when switching inferiors*, making it per-inferior introduces a bug
visible when debugging vforks.  Say: stay attached to both parent/child,
get a backtrace when selecting the child; switch to the parent, change
some piece of memory that would be in the parent's stack dcache; switch
back to parent, and observe that the stack cache is now stale.

-- 
Pedro Alves


  reply	other threads:[~2009-07-10  9:29 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-08 20:49 Jacob Potter
2009-07-08 20:51 ` Pedro Alves
2009-07-08 20:58   ` Pedro Alves
2009-07-08 23:46   ` Daniel Jacobowitz
2009-07-09  3:06     ` Pedro Alves
2009-07-10  9:34       ` Pedro Alves [this message]
2009-07-10  8:45     ` Jacob Potter
2009-07-10 14:19       ` Pedro Alves
2009-07-13 19:25         ` Jacob Potter
2009-08-21  6:25   ` Doug Evans
2009-08-25  3:00     ` Doug Evans
2009-08-25 18:55       ` Pedro Alves
2009-08-26 16:36         ` Doug Evans
2009-08-26 22:45           ` Pedro Alves
2009-08-27  0:46             ` Doug Evans
2009-08-27  3:11               ` Doug Evans
2009-08-29  5:16             ` Doug Evans
2009-08-29 18:28               ` Doug Evans
2009-08-29 20:25               ` Pedro Alves
2009-09-02 20:43       ` Tom Tromey
2009-09-03 15:38         ` Doug Evans
2009-09-03 19:38           ` Tom Tromey
2009-09-03 19:45           ` Daniel Jacobowitz
2009-07-09 12:20 ` Eli Zaretskii

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=200907101029.12135.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=jdpotter@google.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