Commit 492cf34f authored by Martin Milata's avatar Martin Milata Committed by Damien George

tools/mpy-tool.py: Fix offset of line number info.

Signed-off-by: default avatarMartin Milata <martin@martinmilata.cz>
parent 60cf2c09
......@@ -253,6 +253,7 @@ class RawCode(object):
self.ip, self.ip2, self.prelude = extract_prelude(self.bytecode, self.prelude_offset)
self.simple_name = self._unpack_qstr(self.ip2)
self.source_file = self._unpack_qstr(self.ip2 + 2)
self.line_info_offset = self.ip2 + 4
def _unpack_qstr(self, ip):
qst = self.bytecode[ip] | self.bytecode[ip + 1] << 8
......@@ -404,7 +405,10 @@ class RawCode(object):
print(" .n_def_pos_args = %u," % self.prelude[5])
print(" .qstr_block_name = %s," % self.simple_name.qstr_id)
print(" .qstr_source_file = %s," % self.source_file.qstr_id)
print(" .line_info = fun_data_%s + %u," % (self.escaped_name, 0)) # TODO
print(
" .line_info = fun_data_%s + %u,"
% (self.escaped_name, self.line_info_offset)
)
print(" .opcodes = fun_data_%s + %u," % (self.escaped_name, self.ip))
print(" },")
print(" .line_of_definition = %u," % 0) # TODO
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment