Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Rodney M. Bates" <rodney.bates@wichita.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb@sourceware.org
Subject: Re: breakpoint for accessing memory location
Date: Sat, 21 Oct 2006 18:07:00 -0000	[thread overview]
Message-ID: <453A61C5.5010605@wichita.edu> (raw)
In-Reply-To: <ufydhpu0o.fsf@gnu.org>



Eli Zaretskii wrote:
>> 
> Are there any more examples beyond p->f?  That is, what other
> situations are there where the context can matter?  Are we talking
> only about portions of expression going out of context (and thus
> becoming invalid), or are there other problems?
> 
> (You see, I don't think I understand what you mean by ``the semantics
> of evaluating a watchpoint expression'', and a single example you gave
> is not enough for me to figure that out.)
> 

Well, an expression in a program is always interpreted by looking up
any unqualified identifiers according to the scope rules, at the place in the
code where the expression appears.  But with a watchpoint, that place keeps
changing.  p can go out of scope, come back in, or a different p could become
visible.  So more example questions (same expression, different contexts):

If execution gets to where there is no p visible, does the watch get
permanently disabled?  Does execution stop?  Does the watch just get ignored
for now.  If execution comes back into the original scope, does the
expression start getting watched again?

If execution goes somewhere where a different p is visible, does the
watch get disabled?  temporarily ignored?  Is the expression reevaluated
using the new p?  What if this is type-incorrect (e.g. p is not a pointer, or
points to something that doesn't have an f)?  What if a different p points
to the same struct type or a different struct type that also has an f,
and the second f is the same type as the first, or a different type?

What if p is a variable in the original context but a type name in a later
context?  (Maybe there are no expressions that would be legal both ways?)

If the expression is illegal at the place where the program is stopped
when the watch is typed, is it rejected then and there, or kept around
in case, e.g., a p comes into scope.

I realize that the answer to one of my first questions could make the rest
of them irrelevant.  And I presume that just a change in the value of the
same p, while it remains in scope, means the watch now looks for changes to
the f of the new struct p points to, but even this might be worth explaining
explicitly.

As for different expressions, the only thing I think of that could matter
is each occurrence of an unqualified identifier, and these would all presumably
be independent.

-- 
-------------------------------------------------------------
Rodney M. Bates, retired assistant professor
Dept. of Computer Science, Wichita State University
Wichita, KS 67260-0083
316-978-3922
rodney.bates@wichita.edu


  parent reply	other threads:[~2006-10-21 18:07 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-19 20:10 Erik Leunissen
2006-10-19 20:12 ` Daniel Jacobowitz
2006-10-19 20:24   ` Erik Leunissen
2006-10-19 20:25     ` Daniel Jacobowitz
2006-10-19 20:28       ` Erik Leunissen
2006-10-20  6:31     ` Eli Zaretskii
2006-10-20 14:27       ` Daniel Jacobowitz
2006-10-21 13:20         ` [commit] Fix annotations-related index entries (was: breakpoint for accessing memory location) Eli Zaretskii
2006-10-20 16:56       ` breakpoint for accessing memory location Erik Leunissen
2006-10-20 17:39         ` Eli Zaretskii
2006-10-21 12:58         ` Eli Zaretskii
2006-10-21 22:28           ` Erik Leunissen
2006-10-22  4:20             ` Eli Zaretskii
2006-10-22  9:11               ` Erik Leunissen
2006-10-22  9:19                 ` Erik Leunissen
2006-10-22 22:16                 ` Eli Zaretskii
2006-10-23  7:41                   ` Erik Leunissen
2006-10-21 15:06       ` Rodney M. Bates
2006-10-21 15:27         ` Daniel Jacobowitz
2006-10-21 15:29         ` Eli Zaretskii
2006-10-21 15:51           ` Daniel Jacobowitz
2006-10-21 21:26             ` Eli Zaretskii
2006-10-21 22:32               ` Daniel Jacobowitz
2006-10-22  4:18                 ` Eli Zaretskii
2006-10-22  4:22                   ` Daniel Jacobowitz
2006-10-22 12:18                     ` Robert Dewar
2006-10-22 22:18                       ` Eli Zaretskii
2006-10-22 22:21                         ` Daniel Jacobowitz
2006-10-22 22:29                           ` Eli Zaretskii
2006-10-22 22:49                             ` Robert Dewar
2006-10-22 23:18                             ` Daniel Jacobowitz
2006-10-23  2:03                               ` Robert Dewar
2006-10-23  4:11                               ` Eli Zaretskii
2006-10-23 12:36                                 ` Daniel Jacobowitz
2006-10-22 22:48                         ` Robert Dewar
2006-10-22 22:51                           ` Eli Zaretskii
2006-10-22 22:55                             ` Robert Dewar
2006-10-23  4:10                               ` Eli Zaretskii
2006-10-22 20:40                     ` Mark Kettenis
2006-10-21 18:07           ` Rodney M. Bates [this message]
2006-10-21 21:42             ` Eli Zaretskii
2006-10-21 18:55           ` Rodney M. Bates
2006-10-21 21:53             ` Eli Zaretskii
2006-10-22 15:20               ` Rodney M. Bates
2006-10-22 17:24                 ` Daniel Jacobowitz
2006-10-22 22:22                   ` Eli Zaretskii
2006-10-23 22:02                     ` Jim Blandy
2006-10-24  4:32                       ` Eli Zaretskii
2006-10-24 12:57                         ` Daniel Jacobowitz
2006-10-24 17:37                           ` Eli Zaretskii
2006-10-24 17:41                             ` Daniel Jacobowitz

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=453A61C5.5010605@wichita.edu \
    --to=rodney.bates@wichita.edu \
    --cc=eliz@gnu.org \
    --cc=gdb@sourceware.org \
    /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