From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11092 invoked by alias); 10 Aug 2007 09:26:37 -0000 Received: (qmail 10950 invoked by uid 22791); 10 Aug 2007 09:26:36 -0000 X-Spam-Status: No, hits=-0.3 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME X-Spam-Check-By: sourceware.org Received: from agminet01.oracle.com (HELO agminet01.oracle.com) (141.146.126.228) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 10 Aug 2007 09:26:29 +0000 Received: from rgmgw3.us.oracle.com (rgmgw3.us.oracle.com [138.1.186.112]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l7A9QPgw011692 for ; Fri, 10 Aug 2007 04:26:25 -0500 Received: from dhcp-beijing-cdc-10-182-121-20.cn.oracle.com (dhcp-beijing-cdc-10-182-121-20.cn.oracle.com [10.182.121.20]) by rgmgw3.us.oracle.com (Switch-3.2.4/Switch-3.2.4) with ESMTP id l7A9QNBB004458 for ; Fri, 10 Aug 2007 03:26:24 -0600 Subject: [patch] fix bugs of memory window From: Zhao Shujing Reply-To: pearly.zhao@oracle.com To: Frysk Mailing List Content-Type: multipart/mixed; boundary="=-7J7Eg0yVnzQ0F6k3VN3w" Organization: Oracle Date: Fri, 10 Aug 2007 09:26:00 -0000 Message-Id: <1186738176.11132.42.camel@linux-pzhao.site> Mime-Version: 1.0 X-Mailer: Evolution 2.6.0 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAA== X-Whitelist: TRUE X-Whitelist: TRUE X-Virus-Checked: Checked by ClamAV on sourceware.org X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2007-q3/txt/msg00289.txt.bz2 --=-7J7Eg0yVnzQ0F6k3VN3w Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 1055 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 *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 --=-7J7Eg0yVnzQ0F6k3VN3w Content-Description: Content-Disposition: inline; filename=memory.patch Content-Type: text/x-patch; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 2596 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(); } --=-7J7Eg0yVnzQ0F6k3VN3w--