Page 1 of 1

Variables in red in the local variables tab

Posted: Thu Nov 24, 2022 9:49 am
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.


Re: Variables in red in the local variables tab

Posted: Wed Nov 30, 2022 1:19 am
by eranif

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


Re: Variables in red in the local variables tab

Posted: Wed Nov 30, 2022 2:45 am
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.


Re: Variables in red in the local variables tab

Posted: Wed Nov 30, 2022 7:03 pm
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.


Re: Variables in red in the local variables tab

Posted: Sat Dec 03, 2022 2:28 am
by eranif

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


Re: Variables in red in the local variables tab

Posted: Sat Dec 03, 2022 3:57 am
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.