Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Marc Khouzam <marc.khouzam@ericsson.com>
To: "'Pedro Alves'" <palves@redhat.com>
Cc: "'André Pönitz'" <andre.poenitz@mathematik.tu-chemnitz.de>,
	"'Yao Qi'" <yao@codesourcery.com>,
	"'Tom Tromey'" <tromey@redhat.com>,
	"'gdb-patches@sourceware.org'" <gdb-patches@sourceware.org>
Subject: RE: [RFC] MI notification on register changes
Date: Wed, 07 Nov 2012 18:18:00 -0000	[thread overview]
Message-ID: <E59706EF8DB1D147B15BECA3322E4BDC0183CC@EUSAAMB103.ericsson.se> (raw)
In-Reply-To: <509A93C0.9020009@redhat.com>


> -----Original Message-----
> From: Pedro Alves [mailto:palves@redhat.com] 
> Sent: Wednesday, November 07, 2012 12:01 PM
> To: Marc Khouzam
> Cc: 'André Pönitz'; 'Yao Qi'; 'Tom Tromey'; 
> 'gdb-patches@sourceware.org'
> Subject: Re: [RFC] MI notification on register changes
> 
> Marc Khouzam wrote:
> 
> >> André Pönitz wrote:
> >> On Tue, Nov 06, 2012 at 02:04:59PM +0800, Yao Qi wrote:
> >>> If GDB emits a very generic notification (for register change,
> >>> memory change, etc), I am not sure how useful it is.  It would be
> >>> noisy to frondend, IMO.
> >>
> >> Why?
> >>
> >> As soon as a single bit changes somewhere, the only 
> formally correct
> >> response from a frontend is to re-fetch everything.
> > 
> > IIUC, the notifications being proposed will only be triggered if
> > registers are changed by the user.  This is something that 
> the frontend
> > needs to be told about because the assumption is that 
> registers/memory
> > are stable when the program is suspended.  I don't believe a full
> > refresh is needed if such notifications contain the changed info.
> 
> The issue is in the "contain the changed info" part.  In 
> general, we don't have such
> info available.  So there are cases where trusting such fine-grained
> notifications will get you stale views.  For example, in the 
> general case, if the
> user changes registers/memory, we can't assume that 
> memory/registers didn't change.
> Some targets even have memory-mapped registers.  If GDB core 
> shouldn't assume such
> things, then "registers changed" or "memory changed" 
> notifications are in general
> misleading.  We'd have to add notes like "note that even 
> though we're saying only
> a register changed, everything else (memory, stack frame, 
> whole stack, etc.)
> might have changed too, so you're better off refreshing all 
> your views." which may
> be a bit silly.  We may be better off not giving ourselves 
> and the frontends rope to hang ourselves with.

Ok, I understand the problem now.
It should probably up to GDB to determine, if possible,
the safe cases which can specify the "changed info" and 
the unsafe cases which should not, therefore telling the 
frontend to do a full refresh.  Which brings your next
question:

> The related question is then, why is a full refresh an issue, 
> if that is something
> the must already do after every stop, such as e.g., after 
> each "step".  As PR 7574
> hints at, things like "step" are the use cases users will 
> notice and complain
> the most if slow.  It seems like optimizing the frontends 
> with selecting/partial updates
> for some cases still leaves you with needing to optimize the 
> full-refresh case
> anyway for more important cases.

Avoiding a full refresh is probably a result of inertia.
Since GDB allows the frontend to try to avoid a full
refresh by giving extra information in its notifications,
the idea of continuing with that approach seemed the right one.
For instance, GDB could have a single =breakpoints-changed
notif which would trigger a full refresh a breakpoints.
Same for variable objects (see -var-update).  Even
=threads-changed (although this may be a little more
justified if we think about it more deeply).

Fundamentally, erroneous data is the worse case.  So,
having a notification without "changed data" is better 
than an invalid or incomplete "changed data", or no
notification at all :).

So, if there are cases where a full refresh is needed
then I can understand that it may not be worth trying
to provide the "changed data" only once in a while.

Thanks for the explanation.

Marc



  reply	other threads:[~2012-11-07 18:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-23  7:24 Yao Qi
2012-11-01  0:36 ` ping: " Yao Qi
2012-11-01 20:48 ` Tom Tromey
2012-11-02  9:56   ` Yao Qi
2012-11-02 16:42     ` Tom Tromey
2012-11-05 10:26       ` Yao Qi
2012-11-05 20:10         ` Tom Tromey
2012-11-06  6:05           ` Yao Qi
2012-11-06 20:00             ` André Pönitz
2012-11-07 15:35               ` Marc Khouzam
2012-11-07 17:01                 ` Pedro Alves
2012-11-07 18:18                   ` Marc Khouzam [this message]
2012-11-07 18:54                     ` Tom Tromey
2012-11-07 21:09                       ` André Pönitz
2012-11-09  1:47                   ` Yao Qi

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=E59706EF8DB1D147B15BECA3322E4BDC0183CC@EUSAAMB103.ericsson.se \
    --to=marc.khouzam@ericsson.com \
    --cc=andre.poenitz@mathematik.tu-chemnitz.de \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=tromey@redhat.com \
    --cc=yao@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