A running program can initiate a gdb session by calling the function
if (counter == 31523 && ptr == (void*)0x40013fa0)
Encapsulation macro for general debugging code.
opens an xterm (or whatever is configured in the rcfile) and starts the gdb session inside it.After exiting gdb the application will continue running.In order for
to work, you will need to call
at the start of your application.