Skip to content

Commit 71af883

Browse files
committed
Add inlined support
Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>
1 parent b473fac commit 71af883

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

decoder.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ def parse_file(self, file):
132132

133133
for line in file:
134134
func = func(line.strip())
135+
if func is None:
136+
break
135137

136138
if func is not None:
137139
print("ERROR: Parser not complete!")
@@ -149,17 +151,23 @@ def _lookup(self, addresses):
149151
output = subprocess.check_output(cmd, encoding="utf-8")
150152

151153
line_regex = re.compile("^(?P<addr>[0-9a-fx]+): (?P<result>.+)$")
154+
155+
last = None
152156
for line in output.splitlines():
153157
line = line.strip()
154158
match = line_regex.match(line)
155159

156160
if match is None:
161+
if last is not None and line.startswith('(inlined by)'):
162+
line = line [12:].strip()
163+
self._address_map[last] += ("\n \-> inlined by: " + line)
157164
continue
158165

159166
if match.group("result") == '?? ??:0':
160167
continue
161168

162169
self._address_map[match.group("addr")] = match.group("result")
170+
last = match.group("addr")
163171

164172
def fill(self, parser):
165173
addresses = [parser.epc1, parser.epc2, parser.epc3, parser.excvaddr, parser.sp, parser.end, parser.offset]

0 commit comments

Comments
 (0)