From: Andrew Cagney <cagney@redhat.com>
To: Adam Jocksch <ajocksch@redhat.com>
Cc: Sami Wagiaalla <swagiaal@redhat.com>, frysk <frysk@sourceware.org>
Subject: Re: Proposed frysk.rt.Display
Date: Thu, 10 May 2007 18:38:00 -0000 [thread overview]
Message-ID: <464326BB.2040706@redhat.com> (raw)
In-Reply-To: <464216C7.10503@redhat.com>
Adam,
This is a good summary, even the text to put at the top of the task as
the description :-)
First thing I think we've identified is that frysk.value.Variable is
misleading, should be renamed to .Value -- compiler people are familar
with lval and rval as extensions of that :-) It also leads to things
like getRegisterVariable -> getRegisterValue - more sane :-)
That leaves Variable for you and sami to fight over. I wonder though if
for this object, something like VariableMonitor, or VariableTracker will
be more meaningful.
Anyway, the technical challenge here, I think, is defining the
test-cases that are needed to push this object through each of its
possible state transitions. I put it that way as, that way the
test-cases define the objects requirements through hard evidence - and
we don't end up with code that probably isn't needed.
So, assuming for now that there's .getValue(), and a constructor, the
most basic of tests would be, given:
int x = 0;
x = 1; // breakpoint #1
x = 2; // breakpoint #2
run to breakpoint 1, create the object, continue to breakpoint #2, check
the object changed. With this unit test running we can then start to
expand the cases this code needs to cover.
--
A side line here, the obvious way to implement this is by creating
high-level FileLineBreakpoint()s using hard-wired addresses. Lets be a
little inovative though :-) Instead why not add to frysk.testbed code
to find a pattern given a file (perhaps there's a library method
available), and then create a FilePatternBreakpoint instead for
instance, something like:
new FilePatternBreakpoint(new File(getSrcDir(), "path-to.c"), "x = 1;")
going forward I think this will greatly simplify the authoring and
clarity of these tests.
Andrew
Adam Jocksch wrote:
> Sami Wagiaalla wrote:
>> Can you provide more context here please.
>> What is the problem the proposed Display object is solving ?
>>
> The problem is that a Variable object has no concept of when it is in
> or out of scope, as well as when it changes from being in memory to
> being in a register. The Display class will act as a sort of
> intermediary between Variable and classes that wish to access
> Variables (such as variable watches in the source window), such that
> they will not need to worry about checking whether the variable is
> still in scope, in memory or in a register, etc.
next prev parent reply other threads:[~2007-05-10 15:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-09 18:36 Adam Jocksch
2007-05-09 18:45 ` Sami Wagiaalla
2007-05-09 18:47 ` Adam Jocksch
2007-05-10 15:23 ` Sami Wagiaalla
2007-05-10 18:38 ` Andrew Cagney [this message]
2007-05-11 13:44 ` Stan Cox
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=464326BB.2040706@redhat.com \
--to=cagney@redhat.com \
--cc=ajocksch@redhat.com \
--cc=frysk@sourceware.org \
--cc=swagiaal@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).