Debugger collapses expanded struct at breakpoint

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Debugger collapses expanded struct at breakpoint

Jump to solution
882 Views
Cdn_aye
Senior Contributor I

In CW10.x when I have set a breakpoint, and expanded a struct variable in the variables window, CW will often collapse the struct view when I run to the repeated breakpoint in a loop at the same spot. This is obviously a major time waste to have to expand what is often a complex structure to look at a nested variable.

 

1) Is there anyway to prevent this from happening; it doesn't seem to do it all the time, but most of the time.

2) I have to set the variable display format to hex everytime I load the program for each variable. Is there a persistent setting in the debugger that allows the default format to be hex?

3) often the variables window will go blank when I leave a breakpoint andn it remains that way until I click on it; then usually the variables are all collapsed again.

 

What I think should happen is the variables window should stay exactly as it is until it is changed. It should be a trivial excersise for the developers to keep a list of the properties of the variables being viewed in the debugger, and restore these properties to the variables window when a breakpoint is hit.

 

This constant collapsing and clearing the contents in the variables window is like trying to read a book in a wind storm with the pages blowing back and forth. No one would do that, but we forced into this situation with the debugger.

 

Is there anyway around these issues. Thanks for the help.

 

Regards


Robert

Labels (1)
0 Kudos
1 Solution
519 Views
CrasyCat
Specialist III

Hello

On question number 2, I assume you want all global variables values to be displayed as hexadecimal value per default.

Am I right?

If this is what you are looking for:

  • Select Windows > Preferences. The Preferences dialog opens up.
  • Switch to the C/C++ > Debug page
  • Change Default variable format to Hexadecimal.
    Note that you can also adjust default format for displaying Expression or register values there.

CrasyCat

View solution in original post

0 Kudos
4 Replies
519 Views
Cdn_aye
Senior Contributor I

Hi Catherine

Thank you... being able to set the variable state persistently, will save a lot of time and from been driven to distraction.

Hi Erich

I will put together a screen capture of the collapsing variable display problem. I believe is  happening is that the debugger steps out of the current scope of the variable, then later re-enters and because the debugger knows only the current state of the variable and knows not the variable it once knew. It is not persistent because the scope changed.

I would submit that this a simplistist implementation in the world of debugging.

All that the debugger needs to do to solve this problem, is to build a structure in its code space of the variables listed in the debug window, add the scope of the variable to the breakpoint list and other attributes/properties as fields of the object, check this list when a breakpoint is hit, then return the state of the variables in the display it to the last state when the last property of the variable was viewed/changed. Collapsed, not collapsed, hex, natural... , etc. If if can be done by a person manually, it should be trivial to generate a script, or programatically call up the properties of the variable by parsing the properties table at any given state of the debugger when it stops and displays in the debug window.

Thank you for responding.

Robert

0 Kudos
519 Views
BlackNight
NXP Employee
NXP Employee

About 1) I have not noticed this. It might be because I already switched to MCU10.3, and that might be something which has been improved in that new eclipse version (10.3 uses eclipse 3.7 while MCU10.2 uses 3.6).

Maybe you can find a reproducible case, or at least isolate the problem?

About 2) I'm not aware that this is possible.

About 3) Eclipse shows the global variables of the current module (where the program counter is). So if the module/source you stop has no global variables, the global variables list will be empty. How to change this to your needs, see this article:

http://mcuoneclipse.wordpress.com/2012/07/04/debugging-global-variables/

Hope this helps,

Erich

0 Kudos
520 Views
CrasyCat
Specialist III

Hello

On question number 2, I assume you want all global variables values to be displayed as hexadecimal value per default.

Am I right?

If this is what you are looking for:

  • Select Windows > Preferences. The Preferences dialog opens up.
  • Switch to the C/C++ > Debug page
  • Change Default variable format to Hexadecimal.
    Note that you can also adjust default format for displaying Expression or register values there.

CrasyCat

0 Kudos
519 Views
BlackNight
NXP Employee
NXP Employee

Wow! You have found another hidden treasure in Eclipse/MCU10 :-).

I have missed that setting, and indeed it works as expected (to show variables in hexadecimal by default):

hexadecimal.png

then my variables are shown in hexadecimal:

variables in hex.png

really cool! :-)

0 Kudos