This is the mail archive of the
frysk@sourceware.org
mailing list for the frysk project.
Re: [patch] fix bug 4612
- From: Andrew Cagney <cagney at redhat dot com>
- To: pearly dot zhao at oracle dot com
- Cc: Frysk Mailing List <frysk at sourceware dot org>
- Date: Mon, 30 Jul 2007 09:02:19 -0400
- Subject: Re: [patch] fix bug 4612
- References: <1185502689.4051.15.camel@linux-pzhao.site>
Pearly,
The below looks fine. Will you be around tuesday morning (your time?).
I'll send you off list some stuff to do with CVS so that you can check
this in.
Two things to think about though:
-> testing;
When making fixes we all endeavor to author the test-case up-front so
that we can directly demonstrate that the change has the intended effect.
-> it looks like there is much code duplication between the Disassembler
and Memory windows;
an opportunity to refactor?
Andrew
Zhao Shujing wrote:
Hi,
Please take a look at the attached patch.
It is to fix bug 4612.
It also does:
- Make the column display of memory window synchronous with the fromBox
when adjust the fromSpin.
- Do the same to disassembly window when adjust the toSpin.
Thanks
Pearly
------------------------------------------------------------------------
diff -ur frysk-cvs/frysk-gui/frysk/gui/ChangeLog frysk/frysk-gui/frysk/gui/ChangeLog
--- frysk-cvs/frysk-gui/frysk/gui/ChangeLog 2007-07-26 10:11:33.000000000 -0400
+++ frysk/frysk-gui/frysk/gui/ChangeLog 2007-07-26 10:17:20.000000000 -0400
@@ -1,3 +1,13 @@
+2007-07-23 Zhao Shujing <pearly.zhao@oracle.com>
+
+ * memory/MemoryWindow.java: fromBox and toBox can be edited. Fixes
+ #4612.
+ * memory/MemoryWindow.java(handleFromSpin): synchronously display
+ column and fromBox when adjust the fromSpin.
+ * disassembler/DisassemblyWindow.java: fromBox and toBox can be edited.
+ * disassembler/DisassemblyWindow.java(rowAppend): synchronously display
+ column and toBox when adjust the toSpin.
+
2007-07-19 Adam Jocksch <ajocksch@redhat.com>
* sessions/WatchListListener.java: Reformatted.
diff -ur frysk-cvs/frysk-gui/frysk/gui/disassembler/DisassemblyWindow.java frysk/frysk-gui/frysk/gui/disassembler/DisassemblyWindow.java
--- frysk-cvs/frysk-gui/frysk/gui/disassembler/DisassemblyWindow.java 2007-07-26 10:11:33.000000000 -0400
+++ frysk/frysk-gui/frysk/gui/disassembler/DisassemblyWindow.java 2007-07-26 10:14:53.000000000 -0400
@@ -345,12 +345,12 @@
{
public void entryEvent (EntryEvent arg0)
{
- if (arg0.getType() == EntryEvent.Type.CHANGED)
+ if (arg0.getType() == EntryEvent.Type.ACTIVATE)
{
if (refreshLock)
return;
- String str = arg0.getText();
+ String str = fromBox.getText();
try
{
double d = (double) Long.parseLong(str, 16);
@@ -368,12 +368,12 @@
{
public void entryEvent (EntryEvent arg0)
{
- if (arg0.getType() == EntryEvent.Type.CHANGED)
+ if (arg0.getType() == EntryEvent.Type.ACTIVATE)
{
if (refreshLock)
return;
- String str = arg0.getText();
+ String str = toBox.getText();
try
{
double d = (double) Long.parseLong(str, 16);
@@ -592,6 +592,14 @@
this.lastPath.next();
if (ins != null)
{
+ if (li.hasNext())
+ ins = (Instruction) li.next();
+ else
+ {
+ this.toSpin.setValue((double) ins.address);
+ this.lastKnownTo = ins.address;
+ ins = null;
+ }
model.setValue(iter, (DataColumnString) cols[1],
"<pc+" + (ins.address - this.pc) + ">: ");
model.setValue(iter, (DataColumnString) cols[LOC],
@@ -599,14 +607,6 @@
model.setValue(iter, (DataColumnString) cols[2], ins.instruction);
model.setValue(iter, (DataColumnObject) cols[3], ins);
- if (li.hasNext())
- ins = (Instruction) li.next();
- else
- {
- this.toSpin.setValue((double) ins.address);
- this.lastKnownTo = ins.address;
- ins = null;
- }
}
else
model.setValue(iter, (DataColumnString) cols[1], "");
@@ -679,9 +679,10 @@
}
}
- refreshList();
+ this.fromSpin.setValue(val);
this.lastKnownFrom = val;
this.fromBox.setText(Long.toHexString((long) val));
+ refreshList();
}
boolean toToggle = false;
diff -ur frysk-cvs/frysk-gui/frysk/gui/memory/MemoryWindow.java frysk/frysk-gui/frysk/gui/memory/MemoryWindow.java
--- frysk-cvs/frysk-gui/frysk/gui/memory/MemoryWindow.java 2007-07-26 10:11:33.000000000 -0400
+++ frysk/frysk-gui/frysk/gui/memory/MemoryWindow.java 2007-07-26 10:14:45.000000000 -0400
@@ -475,12 +475,12 @@
{
public void entryEvent (EntryEvent arg0)
{
- if (arg0.getType() == EntryEvent.Type.CHANGED)
+ if (arg0.getType() == EntryEvent.Type.ACTIVATE)
{
if (refreshLock)
return;
- String str = arg0.getText();
+ String str = fromBox.getText();
try
{
double d = (double) Long.parseLong(str, 16);
@@ -499,12 +499,12 @@
{
public void entryEvent (EntryEvent arg0)
{
- if (arg0.getType() == EntryEvent.Type.CHANGED)
+ if (arg0.getType() == EntryEvent.Type.ACTIVATE)
{
if (refreshLock)
return;
- String str = arg0.getText();
+ String str = toBox.getText();
try
{
double d = (double) Long.parseLong(str, 16);
@@ -874,7 +874,7 @@
{
TreeIter iter = model.getFirstIter();
- for (int i = (int) lastKnownFrom; i < (int) val; i++)
+ for (long i = (long) lastKnownFrom; i < (long) val; i++)
{
model.removeRow(iter);
iter = iter.getNextIter();
@@ -931,6 +931,7 @@
}
this.toBox.setText(Long.toHexString((long) val));
+ this.toSpin.setValue(val);
refreshList();
}