-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lazily update frames of all threads in all-stop mode #6869
Lazily update frames of all threads in all-stop mode #6869
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try using the cdt-gdb-vscode
extension directly, see how it goes.
Closing for the moment, discussions will be taken offline in the meantime. |
Please study VS Code code base for such changes as a reference implementation, don't invent here. We should align it. |
1ae1e10
to
05a71a2
Compare
@akosyakov the changes look good to me. When you say "we should align [with vscode]", what would you see done differently here? VS Code doesn't use the same model classes as we do, so I see the current change as a minimal way to fix the issue with outdated frames. |
model is not but logic should be the same to respect DAP expectations and timing |
When a breakpoint occurs in a thread in all-stop mode, all other threads have outdated/missing stackframes which means no variables show up and can be inspected. This fixes the issue by marking each thread as potentially having "dirty" frames: frames that need to be re-fetched when the user selects them. Signed-off-by: Samuel Frylmark <samuel.frylmark@ericsson.com>
05a71a2
to
f5867d6
Compare
Bump? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, @akosyakov @tsmaeder ?
@marechal-p let's try, it looks cleaner now, sorry i don't have headspace to think about implications right now or time to try it |
What it does
When a breakpoint occurs in a thread in all-stop mode, all other
threads have outdated/missing stackframes which means no variables
show up and can be inspected. This fixes the issue by marking each
thread as potentially having "dirty" frames: frames that need to be
re-fetched when the user selects them.
How to test
Testing is unfortunately quite complex at the moment. This is because
@theia/cpp-debug
is using an outdated version of a vscode extension. If you test these changes before and after, you'll see that before, you could only access the current thread's frames. After, you'll see that you can play around with all your frames as expected.Step 1: Build the debugger vscode extension manually
The latest release of our fork is using an outdated adapter.
yarn && yarn vsce:package
Python 2:
python -m SimpleHTTPServer
Python 3:
python -m http.server
Step 2: Add the extension to theia
"cdt-gdb-vscode": "http://localhost:8000/cdt-gdb-vscode-0.0.90.vsix"
to the rootpackage.json
under"theiaPlugins"
.plugins/cdt-gdb-vscode
laying around.yarn
at the root, thenyarn start:browser
. If you've only updated the plugin, it's fine to just runyarn download:plugins
instead ofyarn
.Step 3: Get an example workspace
Debug a multi-threaded program with the GDB support, an example is https://github.com/zappala/pthreads-examples-c
make -B CPPFLAGS=-ggdb
.theia/tasks.json
:Step 4: Play around with threads, both before and after this PR!
Review checklist
Reminder for reviewers