From: Zhao Shujing <pearly.zhao@oracle.com>
To: Frysk Mailing List <frysk@sourceware.org>
Subject: [patch] fix bugs of memory window
Date: Fri, 10 Aug 2007 09:26:00 -0000 [thread overview]
Message-ID: <1186738176.11132.42.camel@linux-pzhao.site> (raw)
[-- Attachment #1: Type: text/plain, Size: 1055 bytes --]
Hi,
Can anyone help me to review the attached patch? Thanks. I have tested
at x86_64/FC7.
The patch is mainly to fix the following bugs of memory window:
- fromSpin.setValue would invoke the fromSpin entryEvent again, so the
handleFromSpin is called twice. It happens at toSpin too.
- Prepend row by order from low to high when decrease fromBox.
- removeRow would make iter to set to the next valid row,
iter.getNextIter is not needed after removeRow.
The above-mentioned are happened at disassembly window too. But only
fixing these bugs can not make the window display correctly yet. So
there is no patch for disassembly window this time.
BTW: I'm touching GUI test and the disassembly window and memory window
refactoring. Any suggestions are welcomed.
2007-08-10 Zhao Shujing <pearly.zhao@oracle.com>
*memory/MemoryWindow.java (fromBox.entryEvent): Use
fromSpin.setValue to invoke fromSpin entryEvent.
(toBox.entryEvent): Ditto.
(handleToSpin): Ditto.
(handleFromSpin): Prepend row by the order from high to low.
Thanks
Pearly
[-- Attachment #2: Type: text/x-patch, Size: 2596 bytes --]
Index: frysk-gui/frysk/gui/memory/MemoryWindow.java
===================================================================
RCS file: /cvs/frysk/frysk-gui/frysk/gui/memory/MemoryWindow.java,v
retrieving revision 1.42
diff -u -r1.42 MemoryWindow.java
--- frysk-gui/frysk/gui/memory/MemoryWindow.java 27 Jul 2007 21:07:22 -0000 1.42
+++ frysk-gui/frysk/gui/memory/MemoryWindow.java 10 Aug 2007 08:07:48 -0000
@@ -484,8 +484,15 @@
try
{
double d = (double) Long.parseLong(str, 16);
- //fromSpin.setValue(d);
- handleFromSpin(d);
+ if (d > lastKnownTo)
+ {
+ if (lastKnownTo == lastKnownFrom)
+ handleFromSpin(lastKnownTo);
+ else
+ fromSpin.setValue(lastKnownTo);
+ }
+ else
+ fromSpin.setValue(d);
}
catch (NumberFormatException nfe)
{
@@ -508,8 +515,15 @@
try
{
double d = (double) Long.parseLong(str, 16);
- //toSpin.setValue(d);
- handleToSpin(d);
+ if (d < lastKnownFrom)
+ {
+ if (lastKnownFrom == lastKnownTo)
+ handleToSpin(lastKnownFrom);
+ else
+ toSpin.setValue(lastKnownFrom);
+ }
+ else
+ toSpin.setValue(d);
}
catch (NumberFormatException nfe)
{
@@ -877,12 +891,11 @@
for (long i = (long) lastKnownFrom; i < (long) val; i++)
{
model.removeRow(iter);
- iter = iter.getNextIter();
}
}
else
{
- for (long i = (long) val; i < lastKnownFrom; i++)
+ for (long i = (long) lastKnownFrom - 1; i >= (long) val; i--)
{
TreeIter newRow = model.prependRow();
rowAppend(i, newRow);
@@ -903,7 +916,7 @@
public void handleToSpin (double val)
{
- if (this.model.getFirstIter() == null || val == this.lastKnownTo)
+ if (this.model.getFirstIter() == null)
return;
if (val < this.lastKnownFrom)
@@ -918,8 +931,6 @@
{
for (long i = (long) lastKnownTo + 1; i < val + 1; i++)
rowAppend(i, null);
-
- this.lastKnownTo = val;
}
else
{
@@ -931,7 +942,7 @@
}
this.toBox.setText(Long.toHexString((long) val));
- this.toSpin.setValue(val);
+ this.lastKnownTo = val;
refreshList();
}
next reply other threads:[~2007-08-10 9:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-10 9:26 Zhao Shujing [this message]
2007-08-30 3:51 [patch] Fix " Zhao Shujing
2007-08-30 13:59 ` Andrew Cagney
2007-08-31 6:30 ` Zhao Shujing
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=1186738176.11132.42.camel@linux-pzhao.site \
--to=pearly.zhao@oracle.com \
--cc=frysk@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).