Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Marc Khouzam <marc.khouzam@ericsson.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 17:01:00 -0000	[thread overview]
Message-ID: <509A93C0.9020009@redhat.com> (raw)
In-Reply-To: <E59706EF8DB1D147B15BECA3322E4BDC0180F7@EUSAAMB103.ericsson.se>

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.

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.

-- 
Pedro Alves


  reply	other threads:[~2012-11-07 17:01 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 [this message]
2012-11-07 18:18                   ` Marc Khouzam
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=509A93C0.9020009@redhat.com \
    --to=palves@redhat.com \
    --cc=andre.poenitz@mathematik.tu-chemnitz.de \
    --cc=gdb-patches@sourceware.org \
    --cc=marc.khouzam@ericsson.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