This is an archive of the discontinued LLVM Phabricator instance.

Have lldb-vscode update the currently selecte thread and frame when it receives a "scopes" request.
ClosedPublic

Authored by clayborg on Apr 2 2020, 4:34 PM.

Details

Summary

The IDE has no packets that are sent to lldb-vscode that say which thread and frame are selected. The only way we know is we get a request for variables for a stack frame via a "scopes" request. When we receive this packet we make that thread and frame the selected thread and frame in lldb. This way when people execute lldb commands in the debug console by prefixing the expression with the backtick character, we will have the right thread and frame selected. Previously this was not updated as new stack frames were selected.

Diff Detail

Event Timeline

clayborg created this revision.Apr 2 2020, 4:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 2 2020, 4:34 PM
wallace accepted this revision.Apr 2 2020, 4:48 PM

I agree with the implementation.
I also find no way notify the IDE that the user has switched to a different thread or frame in the console, and I actually think it's better this way.

lldb/test/API/tools/lldb-vscode/console/TestVSCode_console.py
21

just use lldb_command instead of using a formatted string

57

frame #0

58

select

This revision is now accepted and ready to land.Apr 2 2020, 4:48 PM
wallace added inline comments.Apr 2 2020, 4:51 PM
lldb/test/API/tools/lldb-vscode/console/TestVSCode_console.py
21

I didn't notice the backtick. Forget about this

clayborg updated this revision to Diff 254670.Apr 2 2020, 6:32 PM

Fix typos.

commit 5998aceda9fdca04db4d9ee390cec660896bf0bf (HEAD -> master, origin/master, origin/HEAD)
Author: Greg Clayton <gclayton@fb.com>
Date: Thu Apr 2 16:30:33 2020 -0700

Have lldb-vscode update the currently selecte thread and frame when it receives a "scopes" request.

Summary: The IDE has no packets that are sent to lldb-vscode that say which thread and frame are selected. The only way we know is we get a request for variables for a stack frame via a "scopes" request. When we receive this packet we make that thread and frame the selected thread and frame in lldb. This way when people execute lldb commands in the debug console by prefixing the expression with the backtick character, we will have the right thread and frame selected. Previously this was not updated as new stack frames were selected.

Reviewers: labath, aadsm, wallace, JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D77347
clayborg closed this revision.Apr 2 2020, 6:54 PM

looks good

lldb/test/API/tools/lldb-vscode/console/TestVSCode_console.py
22

if you used self.assertIn(contains_string, output, assertmsg), then you wouldn't need to repeat the arguments in the assert message.