Skip to content

Commit

Permalink
Commit missing parts of cf41890.
Browse files Browse the repository at this point in the history
whitequark committed Feb 24, 2016
1 parent cf41890 commit a829b8a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions artiq/compiler/targets.py
Original file line number Diff line number Diff line change
@@ -151,7 +151,11 @@ def symbolize(self, library, addresses):
if addresses == []:
return []

offset_addresses = [hex(addr) for addr in addresses]
# We got a list of return addresses, i.e. addresses of instructions
# just after the call. Offset them back to get an address somewhere
# inside the call instruction (or its delay slot), since that's what
# the backtrace entry should point at.
offset_addresses = [hex(addr - 1) for addr in addresses]
with RunTool([self.triple + "-addr2line", "--addresses", "--functions", "--inlines",
"--exe={library}"] + offset_addresses,
library=library) \
@@ -164,7 +168,7 @@ def symbolize(self, library, addresses):
except StopIteration:
break
if address_or_function[:2] == "0x":
address = int(address_or_function[2:], 16)
address = int(address_or_function[2:], 16) + 1 # remove offset
function = next(lines)
else:
address = backtrace[-1][4] # inlined

0 comments on commit a829b8a

Please sign in to comment.