From: travisutk Date: Thu, 7 Oct 2010 22:18:05 +0000 (+0000) Subject: Backward-compatible peekblock for Chipcon. X-Git-Url: http://git.rot13.org/?p=goodfet;a=commitdiff_plain;h=042a155324ef5b76951e0194f61ab28c1c0521ce Backward-compatible peekblock for Chipcon. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@747 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- diff --git a/client/GoodFET.py b/client/GoodFET.py index e459a91..53026df 100755 --- a/client/GoodFET.py +++ b/client/GoodFET.py @@ -481,7 +481,7 @@ class GoodFET: return self.peek16(0x56); # The following functions ought to be implemented in # every client. - + def infostring(self): a=self.peekbyte(0xff0); b=self.peekbyte(0xff1); @@ -528,7 +528,7 @@ class GoodFET: return self.peekbyte(address); #monitor def peekword(self,address, memory="vn"): """Peek a natively sized word of memory.""" - return self.peek(address); #monitor + return self.peek16(address); #monitor def peekblock(self,address,length,memory="vn"): """Return a block of data.""" data=range(0,length); diff --git a/client/GoodFETCC.py b/client/GoodFETCC.py index 239233e..3e16ca7 100644 --- a/client/GoodFETCC.py +++ b/client/GoodFETCC.py @@ -229,6 +229,12 @@ class GoodFETCC(GoodFET): def CCdebuginstr(self,instr): self.writecmd(self.APP,0x88,len(instr),instr); return ord(self.data[0]); + def peekblock(self,address,length,memory="vn"): + """Return a block of data.""" + data=range(0,length); + for foo in range(0,length): + data[foo]=self.peek8(address+foo,memory); + return data; def peek8(self,address, memory="code"): if(memory=="code" or memory=="flash" or memory=="vn"): return self.CCpeekcodebyte(address); @@ -321,8 +327,6 @@ class GoodFETCC(GoodFET): self.CChaltcpu(); #Get SmartRF Studio regs if they exist. self.loadsymbols(); - - #print "Status: %s." % self.status(); def stop(self): """Stop debugging."""