Skip to content

Support global and file static variables #424

@jreineckearm

Description

@jreineckearm

The CDT GDB adapter currently only displays local variables and registers in the Variables view.
However, you also may want to see global variables and/or file-static variables (see here)

GDB supports enumeration and access through https://sourceware.org/gdb/current/onlinedocs/gdb.html/GDB_002fMI-Symbol-Query.html and https://sourceware.org/gdb/current/onlinedocs/gdb.html/GDB_002fMI-Variable-Objects.html#GDB_002fMI-Variable-Objects

We should add support for global/file-static variables. You currently can only inspect them from the Watch or the Debug Console if you know a certain variable name, or through GDB CLI commands.

Potential caveats

  • Depending on the program, you may have a significant number of such variables. Showing them as a flat list may become expensive on Variable view updates for embedded targets due to the target accesses.
  • File-statics could be always shown or only when they are in scope, i.e. PC is at code from a specific file.

Hence, we need to keep an eye on performance during work on this feature. And may need a setting as a fail-safe to turn this off.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions