User forums > Using Code::Blocks

Why aren't #define'd constants known to debugger?

(1/1)

rogeriodec:
Every time I try to watch a formula that uses a constant, the debugger shows "Not available in current context".

EX:
#define PI 3.14159265
... and watch "x * 180 / PI"...

How can this be solved?

oBFusCATed:
https://stackoverflow.com/questions/2934006/how-do-i-print-a-defined-constant-in-gdb?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

https://sourceware.org/gdb/onlinedocs/gdb/Macros.html

There is no UI for this and I doubt will provide one...

Use enums or proper constants...

Navigation

[0] Message Index

Go to full version