freemyipod r177 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r176‎ | r177 | r178 >
Date:00:35, 26 August 2010
Author:farthen
Status:new
Tags:
Comment:
libembios: fix some bugs
embios.py: improve the formatting of getprocinfo()
Modified paths:
  • /embios/trunk/tools/embios.py (modified) (history)
  • /embios/trunk/tools/libembios.py (modified) (history)

Diff [purge]

Index: embios/trunk/tools/embios.py
@@ -479,9 +479,13 @@
480480 self.logger.info(" CPU time (total): "+str(datetime.timedelta(microseconds=thread.cputime_total))+"\n")
481481 self.logger.info(" Stack address: "+self._hex(thread.stackaddr)+"\n")
482482 self.logger.info(" Registers:\n")
483 - for register in range(16):
484 - self.logger.info(" r"+str(register)+": "+self._hex(thread.regs["r"+str(register)])+"\n")
485 - self.logger.info(" cpsr: "+self._hex(thread.regs.cpsr))
 483+ for registerrange in range(4):
 484+ self.logger.info(" ")
 485+ for register in range(registerrange, 16, 4):
 486+ registerrepr = "r"+str(register)
 487+ self.logger.info("{:3s}: 0x{:08X} ".format(registerrepr, thread.regs["r"+str(register)]))
 488+ self.logger.info("\n")
 489+ self.logger.info(" cpsr: 0x{:08X}".format(thread.regs.cpsr))
486490 self.logger.info("\n")
487491
488492 @command
Index: embios/trunk/tools/libembios.py
@@ -76,6 +76,7 @@
7777
7878 @staticmethod
7979 def _alignsplit(addr, size, blksize, align):
 80+ if size <= blksize: return (size, 0, 0)
8081 end = addr + size
8182 if addr & (align - 1):
8283 bodyaddr = (addr + min(size, blksize)) & ~(align - 1)
@@ -155,7 +156,7 @@
156157 (headsize, bodysize, tailsize) = self._alignsplit(addr, len(data), cout_maxsize, 16)
157158 offset = 0
158159 if headsize != 0:
159 - self.writemem(addr, headsize)
 160+ self.writemem(addr, data[offset:offset+headsize])
160161 offset += headsize
161162 addr += headsize
162163 while bodysize > 0: