Variables in red in the local variables tab

General questions regarding the usage of CodeLite
systemdlete
CodeLite Enthusiast
Posts: 11
Joined: Thu Nov 24, 2022 9:39 am
Genuine User: Yes
IDE Question: c++
Contact:

Variables in red in the local variables tab

Post by systemdlete »

I'm wondering about the exact meaning of variables highlighted in the color red. I notice that when a variable changes, the variable name's color might change to red. But I am also seeing this, sometimes, a step ahead of hitting the statement where the variable is updated.

I am using codelite 16.0.0 on Devuan Chimaera. This is a stock install from your repos, not a home build. Thank you for your explanation.

User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Variables in red in the local variables tab

Post by eranif »

can you please provide a screenshot as I am not sure what you mean

Make sure you have read the HOW TO POST thread
systemdlete
CodeLite Enthusiast
Posts: 11
Joined: Thu Nov 24, 2022 9:39 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Variables in red in the local variables tab

Post by systemdlete »

I'm referring to the variables listed in the "Debugger" panel in the tab "Locals." Mostly, it does seem that when a variable changes, its updated value will then be reflected, and its name will be sort of "highlighted" in red, rather than the normal black. At least, that seems to be the intention.

However, I think I have seen cases where Codelite (or maybe gdb, idk) seems to sort of anticipate just prior to the change, e.g., when single stepping through code. It is also quite possible, eranif, that a bug in my own code may have corrupted either codelite's or gdb's idea of when the data was actually being modified (by me running MY code in Codelite). In fact, considering how many bugs in my own code I found early on, this is likely the reason, but I am not 100% certain of it.

I am not sure I can reproduce it now, but if I come across it again, I'll try to make a movie and post it here. A single still shot of the screen won't really illustrate the issue.

As an aside, though, could you or someone here confirm that the red highlighting is meant to draw user's attention to which variables have been updated? Again, from what I can tell by using Codelite, it seems that is the idea. Or maybe the intention is to tell the user an error has occurred, and places the variable name in red to signal this.

User avatar
Jarod42
CodeLite Expert
Posts: 237
Joined: Wed Sep 30, 2009 5:54 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: Variables in red in the local variables tab

Post by Jarod42 »

Indeed, just modified variables in debugger have their value in red.

When setting variable to same value, there seems to be a quick flash from red to regular color.
Maybe it is what you encountered.

User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Variables in red in the local variables tab

Post by eranif »

like @Jarod42 said: variables modified between debugger steps, are coloured in red

Make sure you have read the HOW TO POST thread
systemdlete
CodeLite Enthusiast
Posts: 11
Joined: Thu Nov 24, 2022 9:39 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Variables in red in the local variables tab

Post by systemdlete »

Thank you both for the confirmation. I figured that was all it was, but wanted to be sure that I might not have been doing something incorrectly.

Post Reply