Skip to content

Commit

Permalink
Small update to the arm architecture to fix endless recursion bug; Sm…
Browse files Browse the repository at this point in the history
…all typo fixes (#117)
  • Loading branch information
albrecht-flo authored Mar 8, 2023
1 parent dd3f025 commit 5656c12
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions avatar2/archs/arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ def register_write_cb(avatar, *args, **kwargs):
shiftval = 24

if args[0] == 'pc' or args[0] == 'cpsr':
cpsr = qemu.read_register('cpsr')
cpsr = qemu.protocols.registers.read_register('cpsr')
if cpsr & 1<< shiftval:
return
else:
cpsr |= 1<<shiftval
qemu.write_register('cpsr', cpsr)
qemu.protocols.registers.write_register('cpsr', cpsr)

@staticmethod
def init(avatar):
Expand Down
2 changes: 1 addition & 1 deletion avatar2/protocols/gdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ def write_memory(self, address, wordsize, val, num_words=1, raw=False):
def read_memory(self, address, wordsize=4, num_words=1, raw=False):
"""reads memory
:param address: Address to write to
:param address: Address to read from
:param wordsize: the size of a read word (1, 2, 4 or 8)
:param num_words: the amount of read words
:param raw: Whether the read memory should be returned unprocessed
Expand Down
2 changes: 1 addition & 1 deletion avatar2/protocols/qmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ def x86_get_segment_register_base(self, reg):
regs = self.get_registers(raw=True)
regs_r = re.findall(reg.upper()+'\s?=[0-9a-f]+\s([0-9a-f]+)', regs)
if len(regs_r) != 1:
raise exception("Couldn't retrieve base for %s" % reg)
raise Exception("Couldn't retrieve base for %s" % reg)

return int(regs_r[0], 16)

0 comments on commit 5656c12

Please sign in to comment.