0
votes

During Debug mode, if we add Dynamic Printf breakpoint; Eclipse CDT adds an entry in the 'Breakpoints' view but it doesn't display content for dynamic printf on the Console.

Tried both checking and unchecking 'Allocate console (necessary for input)' under 'Common' tab in Debug Configurations, but Dynamic Printf isn't working.

Environment: Eclipse CDT (Oxygen) and GNU gdb (GDB) 7.6.1 running on Windows 7 64-bit.

If we hover over Dynamic Printf breakpoint, it shows below warning:

enter image description here

Any inputs to get Dynamic Printf feature working on Eclipse CDT?

1
Probably optimizer get rid of your code and that line does not exists. Try compiling with -O0 option - LPs
@LPs No luck as the code is already being built by internal builder that uses option -O0. - Xplora
16:27:28 **** Rebuild of configuration Debug for project DynamicPrintf **** Info: Internal Builder is used for build gcc -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\DynamicPrintf.o" "..\\src\\DynamicPrintf.c" gcc -o DynamicPrintf.exe "src\\DynamicPrintf.o" - Xplora

1 Answers

3
votes

CDT only support Dynamic Printf breakpoints from GDB 7.7 and later.

Have a look at the feature bugzilla for the details, but the short story is GDB 7.5 and 7.6 had too many bugs for CDT to reasonably support.