Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <ghost@cs.msu.su>
To: "Frédéric Riss" <frederic.riss@gmail.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC] Prints the frame id when target stops
Date: Wed, 17 Jan 2007 22:14:00 -0000	[thread overview]
Message-ID: <200701180114.20338.ghost@cs.msu.su> (raw)
In-Reply-To: <1169071153.5155.71.camel@funkylaptop>

On Thursday 18 January 2007 00:59, Frédéric Riss wrote:
> Le jeudi 18 janvier 2007 à 00:37 +0300, Vladimir Prus a écrit :
> > >> It actually won't. If -stack-list-frames is changed to return cached
> > >> result when it's absolutely clear that the stack did not change, you
> > >> have no behaviour change, just better performance.
> > > 
> > > Unforunately, making absolutely sure the stack did not change may not
> > > be possible.
> > 
> > Are you sure? For example, if the only command since previous 
> > -stack-list-frames was -exec-step, then the stack is the same.
> > 
> > For the cases where we're not sure, gdb can discard cached value
> > and produce new.
> > 
> > The thing is, if the frontend tries to compare old frame id to
> > new frame id, and skip -stack-list-frames if they are equal,
> > it's not going to be any more reliable than doing similar check
> > in gdb. And in gdb, we can have better checks.
> 
> Have you an idea how you would like the caching to work? Do you mean not
> discarding the frame cache, or caching the returned string?
> 
> If you want the first approach (keep the frame cache), then this is
> quite an intrusive change. It would also require keeping a frame cache
> per-thread and not as a global like it's done now.

No, I don't have the slightest inclination to touch that.

> If you just want to cache the result of -stack-list-frames, then you'd
> have to edit out the addr field which contains the frame's PC for the
> top frame... not very nice.

Or introduce 'struct cached_result_of_stack_list_frames' that
can contain whatever I like and which can be conveniently edited.

You've actually pointed a nice problem -- if frontend avoid -stack-list-frames
when frame id did not change, it will have stale address of the top frame too.

> Also, I don't see how we could have better checks within GDB than within
> the frontend. The only reliable check is IMHO to compare frame ids after
> steps and nexts. Any other execution control command requires to
> re-unwind the whole stack. This check seems to be as reliable in the
> frontend as in GDB.

GDB always knows that it does a step. A frontend might be sending
a command typed by the user, and that might be user-defined command,
and there's no way to tell if there's step in that command.

> I agree with your point though: making -stack-list-frames as fast as
> possible would benefit all frontends. However, it seems hard to modify
> GDB's frame handling to handle that correctly.

I think there are some simple optimizations we might make.

- Volodya


  reply	other threads:[~2007-01-17 22:14 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-15 16:21 Denis PILAT
2007-01-15 21:37 ` Nick Roberts
2007-01-15 23:11   ` Nick Roberts
2007-01-15 23:49     ` Nick Roberts
2007-01-17  8:26       ` Denis PILAT
2007-01-16 16:20 ` Vladimir Prus
2007-01-16 21:12   ` Nick Roberts
2007-01-16 23:38     ` Vladimir Prus
2007-01-17  6:18       ` Daniel Jacobowitz
2007-01-17 21:46         ` Vladimir Prus
2007-01-20 17:02           ` Daniel Jacobowitz
2007-01-17 21:29       ` Mark Kettenis
2007-01-17 21:38         ` Vladimir Prus
2007-01-17 21:59           ` Frédéric Riss
2007-01-17 22:14             ` Vladimir Prus [this message]
2007-01-18  8:00               ` Frederic RISS
2007-01-17 22:17             ` Daniel Jacobowitz
2007-01-18  7:58               ` Frederic RISS
2007-01-18 18:34                 ` Jim Blandy
2007-01-19 14:28                   ` Denis PILAT
2007-01-20 17:00                     ` Daniel Jacobowitz
2007-01-18 19:59                 ` Daniel Jacobowitz
2007-01-17  6:19     ` Daniel Jacobowitz
2007-01-18 21:13       ` Nick Roberts

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=200701180114.20338.ghost@cs.msu.su \
    --to=ghost@cs.msu.su \
    --cc=frederic.riss@gmail.com \
    --cc=gdb-patches@sources.redhat.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