WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [xenppc-unstable] [ppc] gpproxy cleanups

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [xenppc-unstable] [ppc] gpproxy cleanups
From: Xen patchbot-xenppc-unstable <patchbot-xenppc-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 06 Jul 2006 20:40:40 +0000
Delivery-date: Thu, 06 Jul 2006 13:52:04 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Hollis Blanchard <hollisb@xxxxxxxxxx>
# Node ID 4cab8bf721101f377a459a1b8ac7da6c6e241a52
# Parent  e6c7667c97eda1ba63ca749f102f87328e8375a1
[ppc] gpproxy cleanups
- remove unused variable
- correct set/get_register() error-handling
- add todo comment for better error-checking in cmd_set_reg() packet parsing
Signed-off-by: Hollis Blanchard <hollisb@xxxxxxxxxx>
---
 tools/gpproxy/gdbremote.py |    3 +++
 tools/gpproxy/powerpc.py   |   22 +++++++++-------------
 2 files changed, 12 insertions(+), 13 deletions(-)

diff -r e6c7667c97ed -r 4cab8bf72110 tools/gpproxy/gdbremote.py
--- a/tools/gpproxy/gdbremote.py        Thu Jul 06 06:47:16 2006 -0400
+++ b/tools/gpproxy/gdbremote.py        Thu Jul 06 15:35:47 2006 -0500
@@ -302,9 +302,12 @@ class GDBRemoteHandler(SocketServer.Base
 
        def cmd_set_reg(self, pkt, replypkt):
                self.ack()
+
+               # XXX better error-checking here
                num_end = pkt.payload.find("=")
                num = int(pkt.payload[:num_end], 16)
                val = int(pkt.payload[num_end + 1:], 16)
+
                replypkt.payload = self.arch.set_register(num, val)
                return True
 
diff -r e6c7667c97ed -r 4cab8bf72110 tools/gpproxy/powerpc.py
--- a/tools/gpproxy/powerpc.py  Thu Jul 06 06:47:16 2006 -0400
+++ b/tools/gpproxy/powerpc.py  Thu Jul 06 15:35:47 2006 -0500
@@ -21,18 +21,14 @@ class PowerPC:
 class PowerPC:
        def __init__(self, target):
                self.target = target
+
                # initialize REGS array
-               i = 0
 
-               # GPRs
-               for j in range(32):
-                       REGS.append("r%s" % j)
-                       i += 1
+               for i in range(32):
+                       REGS.append("r%s" % i)
 
-               # FPRs
-               for j in range(32):
-                       REGS.append("fr%s" % j)
-                       i += 1
+               for i in range(32):
+                       REGS.append("fr%s" % i)
 
                REGS.append("pc")
                REGS.append("msr")
@@ -45,15 +41,15 @@ class PowerPC:
        def get_register(self, num):
                try:
                        regname = REGS[num]
-               except:
-                       return "x" # unfetchable
+               except IndexError:
+                       return "E16" # unfetchable
                return self.target.get_register(regname)
 
        def set_register(self, num, val):
                try:
                        regname = REGS[num]
-               except:
-                       return "x" # unfetchable
+               except IndexError:
+                       return "E16" # unfetchable
                self.target.set_register(regname, val)
                return "OK"
 

_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [XenPPC] [xenppc-unstable] [ppc] gpproxy cleanups, Xen patchbot-xenppc-unstable <=