Skip to content

Commit 078d911

Browse files
committed
In disasassembly, line 0 is okay
1 parent e718de0 commit 078d911

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

trepan/processor/print.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ def prefix_for_source_text(source_text: str, maxwidth: int) -> str:
190190
while i_stack >= 0:
191191
frame, line_number, column_number = proc_obj.stack[i_stack]
192192

193+
orig_line_number = line_number
193194
# Before starting a program a location for a module with
194195
# line number 0 may be reported. Treat that as though
195196
# we were on the first line.
@@ -301,6 +302,8 @@ def prefix_for_source_text(source_text: str, maxwidth: int) -> str:
301302

302303
is_pyasm = pyficache.is_python_assembly_file(remapped_file or filename)
303304
if is_pyasm:
305+
if orig_line_number == 0:
306+
line_number = 0
304307
line, remapped_line_number = pyficache.get_pyasm_line(
305308
filename, line_number, is_source_line=True, offset=frame.f_lasti,
306309
)

0 commit comments

Comments
 (0)