public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: pmuldoon@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Fix length set bit issues, and length set reading issues.
Date: Fri, 04 Apr 2008 20:46:00 -0000	[thread overview]
Message-ID: <20080404204620.1811.qmail@sourceware.org> (raw)

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 <pmuldoon@redhat.com>
Date:   Fri Apr 4 21:45:52 2008 +0100

    Fix length set bit issues, and length set reading issues.
    
    2008-04-04  Phil Muldoon  <pmuldoon@redhat.com>
    
            * 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  <pmuldoon@redhat.com>
 
+	* 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


                 reply	other threads:[~2008-04-04 20:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20080404204620.1811.qmail@sourceware.org \
    --to=pmuldoon@sourceware.org \
    --cc=frysk-cvs@sourceware.org \
    --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).