Skip to content

Commit 3e27125

Browse files
committed
Adjust "info frame" for new API
1 parent 153fdc4 commit 3e27125

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • trepan/processor/command/info_subcmd

trepan/processor/command/info_subcmd/frame.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from trepan.lib.complete import complete_token
2222
from trepan.lib.disassemble import PYTHON_OPCODES as python_opcodes
2323
from trepan.lib.format import Function, Keyword, format_token
24-
from trepan.lib.stack import format_function_name
24+
from trepan.lib.stack import format_function_name, get_column_start_from_frame
2525
from trepan.lib.thred import current_thread_name
2626
from trepan.processor import frame as Mframe
2727
from trepan.processor.print import format_code, format_frame
@@ -150,6 +150,13 @@ def run(self, args):
150150
formatted_text = highlight_string(line_text.strip(), style=style)
151151
self.msg_nocr(f" current line number: {frame.f_lineno}: {formatted_text}")
152152

153+
start_column = get_column_start_from_frame(frame)
154+
if start_column >= 0:
155+
self.msg(f" starting column: {start_column}")
156+
else:
157+
formatted_text = highlight_string(line_text.strip(), style=style)
158+
self.msg_nocr(f" current line number: {frame.f_lineno}: {formatted_text}")
159+
153160
f_lasti = frame.f_lasti
154161
if f_lasti >= 0:
155162
opname = python_opcodes.opname[code.co_code[f_lasti]]

0 commit comments

Comments
 (0)