Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: rogeriodec on March 21, 2018, 12:16:14 am

Title: Debug Watch Formula?
Post by: rogeriodec on March 21, 2018, 12:16:14 am
In debug, while watching variables, is it possible to create an auxiliary formula (out of code)?
Example: my variable "a" has an angle in radians, but I would also like to see the same angle in degrees, so I would create a formula (a * 180 / 3.1415927) to see the contents of the variable also in degrees.
But as I said, this formula would not be in the code, but only in the debug.
Title: Re: Debug Watch Formula?
Post by: oBFusCATed on March 21, 2018, 12:41:24 am
Yes, you can do it.
Right click -> Rename and type your expression. A short cut for this is pressing the Insert key.
Title: Re: Debug Watch Formula?
Post by: rogeriodec on March 21, 2018, 01:01:37 am
This option is greyed out. Why?
Title: Re: Debug Watch Formula?
Post by: oBFusCATed on March 21, 2018, 09:47:26 am
Locals and function arguments cannot be renamed.
You have to add the watch manually below them.
Title: Re: Debug Watch Formula?
Post by: rogeriodec on March 21, 2018, 02:08:08 pm
Thanks, but I'm not finding how to do this.
Right click where? In the "Whatches" window I can not get anything. The Insert key also does not change anything.
Title: Re: Debug Watch Formula?
Post by: Quiss on March 21, 2018, 02:38:49 pm
Right click the variable in the code, then select "watch 'variable'".
Title: Re: Debug Watch Formula?
Post by: oBFusCATed on March 21, 2018, 04:00:29 pm
There is also one empty row at the bottom were you can start typing your expression.
Title: Re: Debug Watch Formula?
Post by: rogeriodec on March 21, 2018, 04:47:32 pm
Now I got it!
Thank you very much.