tools/mpy-tool.py: Fix offset of line number info.
Signed-off-by: Martin Milata <martin@martinmilata.cz>
This commit is contained in:
parent
60cf2c0959
commit
492cf34fd8
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user