Changed evaluation of variables to functions of gdb #390
+46
−32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While adding "gdbtarget" to the extension "RTOS Viewer" I was wondering about the relatively complex handling of variable evaluation inside function handleVariableRequestObject() in src/gdb/GDBDebugSessionBase.ts. The issue was, that some of the RTOS variables could not be evaluated because of the array handling. Struct members were encapsulated into [] brackets where they shouldn't.
I refactored parts of that module to use gdb mi commands, see: https://sourceware.org/gdb/current/onlinedocs/gdb.html/GDB_002fMI-Variable-Objects.html
-var-info-expression (for display elements)
-var-info-path-expression (to create and store expressions)
A "major" change is, that array elements are now displayed as "0 = ..." instaed of "[0] = ...".
After this change, the RTOS Viewer displayed FreeRTOS, and my tests with global nested struct / array variables did not show any issue.