From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1852 invoked by alias); 4 Apr 2008 20:46:20 -0000 Received: (qmail 1826 invoked by uid 9514); 4 Apr 2008 20:46:20 -0000 Date: Fri, 04 Apr 2008 20:46:00 -0000 Message-ID: <20080404204620.1811.qmail@sourceware.org> From: pmuldoon@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Fix length set bit issues, and length set reading issues. X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 29f47275f3883d5fccd3068eabd29f76395641fb X-Git-Newrev: 05a55f67efefeea21a1a7fe679a82800da5816e7 Mailing-List: contact frysk-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-cvs-owner@sourceware.org Reply-To: frysk@sourceware.org X-SW-Source: 2008-q2/txt/msg00050.txt.bz2 The branch, master has been updated via 05a55f67efefeea21a1a7fe679a82800da5816e7 (commit) from 29f47275f3883d5fccd3068eabd29f76395641fb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 05a55f67efefeea21a1a7fe679a82800da5816e7 Author: Phil Muldoon Date: Fri Apr 4 21:45:52 2008 +0100 Fix length set bit issues, and length set reading issues. 2008-04-04 Phil Muldoon * X8664WatchpointFunctions.java (setWatchpoint): Set 2 byte watch to binary flags: 01, not 10. Set 8 bytes watch binary flag to 10, not 01. (readWatchpoint): Fix bit settings to detect above on read. * IA32WatchpointFunctions.java (setWatchpoint): Set 2 byte watch to binary flag 01, not 10. Delete 8 byte case, not relevant in IA32. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/isa/watchpoints/ChangeLog | 6 +++++ .../isa/watchpoints/IA32WatchpointFunctions.java | 22 +++++++++---------- .../isa/watchpoints/X8664WatchpointFunctions.java | 16 +++++++------- 3 files changed, 24 insertions(+), 20 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/isa/watchpoints/ChangeLog b/frysk-core/frysk/isa/watchpoints/ChangeLog index 4d0e585..4c408b4 100644 --- a/frysk-core/frysk/isa/watchpoints/ChangeLog +++ b/frysk-core/frysk/isa/watchpoints/ChangeLog @@ -1,5 +1,11 @@ 2008-04-04 Phil Muldoon + * X8664WatchpointFunctions.java (setWatchpoint): Set 2 byte watch to + binary flags: 01, not 10. Set 8 bytes watch binary flag to 10, not 01. + (readWatchpoint): Fix bit settings to detect above on read. + * IA32WatchpointFunctions.java (setWatchpoint): Set 2 byte watch to + binary flag 01, not 10. Delete 8 byte case, not relevant in IA32. + * TestWatchpoint.java (testWatchpointTrigger): New. (WatchpointObserver): New. (TerminatedObserver): New. diff --git a/frysk-core/frysk/isa/watchpoints/IA32WatchpointFunctions.java b/frysk-core/frysk/isa/watchpoints/IA32WatchpointFunctions.java index e7cc0a8..c8964db 100644 --- a/frysk-core/frysk/isa/watchpoints/IA32WatchpointFunctions.java +++ b/frysk-core/frysk/isa/watchpoints/IA32WatchpointFunctions.java @@ -119,17 +119,13 @@ class IA32WatchpointFunctions extends WatchpointFunctions { debugControl &= ~(1L << length+1); break; case 2: - debugControl &= ~(1L << length); - debugControl |= (1L << length+1); + debugControl |= (1L << length); + debugControl &= ~(1L << length+1); break; case 4: debugControl |=(1L << length); debugControl |= (1L << length+1); break; - case 8: - debugControl |= (1L << length); - debugControl &= ~(1L << length+1); - break; } task.setRegister(IA32Registers.DEBUG_CONTROL, debugControl); @@ -174,14 +170,16 @@ class IA32WatchpointFunctions extends WatchpointFunctions { // Test length on combination of bits. 00 = 1, 01 = 2 // 11 = 4. - if (!testBit(debugStatus,lengthOfWP)) + if (!testBit(debugStatus,lengthOfWP)) { if (!testBit(debugStatus,lengthOfWP+1)) - length = 1; + length = 1; + } else { + if (!testBit(debugStatus,lengthOfWP+1)) + length = 2; else - length = 2; - else - if (testBit(debugStatus, lengthOfWP)) - length = 4; + length = 4; + } + return Watchpoint.create(address, length, index, writeOnly); } diff --git a/frysk-core/frysk/isa/watchpoints/X8664WatchpointFunctions.java b/frysk-core/frysk/isa/watchpoints/X8664WatchpointFunctions.java index 5b9aa03..b227be6 100644 --- a/frysk-core/frysk/isa/watchpoints/X8664WatchpointFunctions.java +++ b/frysk-core/frysk/isa/watchpoints/X8664WatchpointFunctions.java @@ -116,16 +116,16 @@ class X8664WatchpointFunctions extends WatchpointFunctions { debugControl &= ~(1L << length+1); break; case 2: - debugControl &= ~(1L << length); - debugControl |= (1L << length+1); + debugControl |= (1L << length); + debugControl &= ~(1L << length+1); break; case 4: debugControl |=(1L << length); debugControl |= (1L << length+1); break; case 8: - debugControl |= (1L << length); - debugControl &= ~(1L << length+1); + debugControl &= ~(1L << length); + debugControl |= (1L << length+1); break; } @@ -167,17 +167,17 @@ class X8664WatchpointFunctions extends WatchpointFunctions { // Move over +2 bits for length int lengthOfWP = typeOfWpTrap + 2; int length = 0; - + // Test length on combination of bits. 00 = 1 bytes, 01 = 2 // 11 = 4 and 10 = 8 if (!testBit(debugStatus,lengthOfWP)) if (!testBit(debugStatus,lengthOfWP+1)) length = 1; else - length = 2; - else - if (!testBit(debugStatus, lengthOfWP)) length = 8; + else + if (!testBit(debugStatus, lengthOfWP+1)) + length = 2; else length = 4; return Watchpoint.create(address, length, index, writeOnly); hooks/post-receive -- frysk system monitor/debugger