Skip to content
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

Reset tree tracking when scopes response received #86

Conversation

colin-grant-work
Copy link
Contributor

@colin-grant-work colin-grant-work commented Feb 28, 2024

What it does

The code for tracking variables would sometimes report variables multiple times if the variablesReference value for a given scope (e.g. 'Locals') changed.

image

This PR adjusts the handling to clear the tree when the response to the scopes request is received: that request implies that all scopes will be refreshed (possible with different variablesReference values), so that whatever old data is available locally is (possibly) invalid.

NB: we'll have some work coming in from @WyoTwT that will make the variable retrieval for Memory Inspector views independent of the routine fetching for a debug session.

How to test

  1. Debug a program (e.g. with the CDT GDB adapter)
  2. Load the memory view with variables visible.
  3. Step a number of times (e.g. through a loop)
  4. Observe that a given variable only appears once in the variables column.

Review checklist

Reminder for reviewers

Copy link
Contributor

@jreineckearm jreineckearm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good and makes sense.
Tested with Arm Debugger debug adapter and works as expected.

Copy link
Contributor

@planger planger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, that makes sense! Tested with CDT GDB Adapter for a simple CMake project.

@colin-grant-work colin-grant-work merged commit ae179b8 into eclipse-cdt-cloud:main Mar 1, 2024
5 checks passed
@colin-grant-work colin-grant-work deleted the bugfix/cloned-variables branch March 1, 2024 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants