Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[dsdp-dd-dev] local variables view modes

There is a feature we've developed in our CDT-based debugger that we would like to contribute if there is general interest in it.

A function can contain any number of local variables. Typically, not all of the variables are necessarily "live" at every point along the function code, but often there is a storage representation for each. Consider the following simple scenario

void foo()
{
   int var1;
   {
      int var2;
   }
   var1 = 0;   <--- program is stopped here
   int var3 = 0;
}

Our debugger can support showing "all locals", which means that the variables view will display all three local variables (depending on the sym information), even though only one is in scope at the stopped location (PC). Our debugger also has the ability to show only "live" variables, which means that in the above example, it would just show var1. Finally, our debugger also has the ability to show only variables that are referenced within a few source lines of the current PC; here it does a very simple scan (i.e., grep) of the source to make that determination (no preprocessor support).

The user can cycle through these modes during a debug session.

Does anyone with a CDT based debugger find this feature useful? Distinguishing variables between "all" and "live" requires debugger backend involvement. The "near PC" mode does not. We had to enhance CDT/CDI to implement this feature. We'd like to contribute this to the community and have it be out of our customization domain, but if no one else has a need for this, we won't bother trying.

John



Back to the top