Skip to content

Commit

Permalink
[Review] scripts/symbolize.py: try to resolve abort address to symbol…
Browse files Browse the repository at this point in the history
…/section[+offset]

- Replace tab by spaces
- Initialize ret to '' rather than None

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
  • Loading branch information
jforissier committed Aug 30, 2017
1 parent 3c05d73 commit cc3f47c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions scripts/symbolize.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def resolve(self, addr):
return ret

def symbol_plus_offset(self, addr):
ret = None
ret = ''
prevsize = 0
reladdr = self.subtract_load_addr(addr)
elf = self.get_elf(self._bin)
Expand Down Expand Up @@ -171,13 +171,11 @@ def symbol_plus_offset(self, addr):
break
prevsize = size
prevname = name
if ret is None:
ret = ''
nm.terminate()
return ret

def section_plus_offset(self, addr):
ret = None
ret = ''
reladdr = self.subtract_load_addr(addr)
elf = self.get_elf(self._bin)
cmd = self.arch_prefix('objdump')
Expand All @@ -192,7 +190,7 @@ def section_plus_offset(self, addr):
idx, name, size, vma, lma, offs, algn = line.split()
except:
continue;
ivma = int(vma, 16)
ivma = int(vma, 16)
isize = int(size, 16)
if ivma == iaddr:
ret = name
Expand All @@ -201,8 +199,6 @@ def section_plus_offset(self, addr):
offs = iaddr - ivma
ret = name + '+' + str(offs)
break
if ret is None:
ret = ''
objdump.terminate()
return ret

Expand Down

0 comments on commit cc3f47c

Please sign in to comment.