implemented ARMget_registers() using ldm from user mode. problem is it takes twice...
authordodge-this <dodge-this@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sat, 28 Aug 2010 12:09:16 +0000 (12:09 +0000)
committerdodge-this <dodge-this@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sat, 28 Aug 2010 12:09:16 +0000 (12:09 +0000)
about to revert it to the old method but wanted to save the work.

git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@712 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

client/GoodFETARM7.py

index 4e03e50..83fc516 100644 (file)
@@ -13,8 +13,8 @@
 #  * -ancilary/faster- ldm/stm versions of memory access  (had trouble in past, possibly also due to haphazard abuse of DCLK)
 #  
 # fixme now stuff:
 #  * -ancilary/faster- ldm/stm versions of memory access  (had trouble in past, possibly also due to haphazard abuse of DCLK)
 #  
 # fixme now stuff:
-#  * thumb mode get/set_register
-#  * thumb to arm mode
+#  * thumb mode get/set_register    - DONE!
+#  * thumb to arm mode              - DONE!
 #  * rethink the whole python/c trade-off for cross-python session debugging
 
 import sys, binascii, struct, time
 #  * rethink the whole python/c trade-off for cross-python session debugging
 
 import sys, binascii, struct, time
@@ -304,7 +304,11 @@ class GoodFETARM(GoodFET):
         return retval
     def ARMget_registers(self):
         """Get ARM Registers"""
         return retval
     def ARMget_registers(self):
         """Get ARM Registers"""
-        regs = [ self.ARMget_register(x) for x in range(15) ]
+        # FIXME: should we clobber r15 first?  if results get wonky, we will.
+        self.ARMdebuginstr(ARM_INSTR_SKANKREGS,0)
+        self.ARM_nop(0)
+        self.ARM_nop(0)
+        regs = [ struct.unpack("<L", self.ARM_nop(0))[0] for x in range(15) ]
         regs.append(self.ARMgetPC())            # make sure we snag the "static" version of PC
         return regs
     def ARMset_registers(self, regs, mask):
         regs.append(self.ARMgetPC())            # make sure we snag the "static" version of PC
         return regs
     def ARMset_registers(self, regs, mask):