Re: [Dev-C++] override the debugger run command-line
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Alfred P. R. <al...@ya...> - 2005-09-20 21:11:33
|
Hi BR,
I've a similar problem developing a plug-in for GIMP. Though it produces an executable, the executable is not standalone and must be called through GIMP. Hence, I can use gdb, but with a slight modification to the code to allow for attachment through gdb once the plug-in is active.
In the h file, I place the following:
static gboolean d_l = true; // Debug loop exit test flag.
static gint32 d_v = 0x55AA55AA; // Dummy variable to allow the debug routine something to do.
Then in my main code I place the following:
// Debug wait here.
#ifdef DEBUG
do {
shapefs.d_c();
} while (d_l == true); // Make this variable false to continue with program flow.
#endif
Then I create a procedure called d_c():
void GIMP_SFS::d_c (void)
{ /* If DEBUG is defined, will loop in this function forever until attached by
the debugger and the value d_l set to false.
*/
d_v = ~d_v; // Just something to do.
}
I start the debugger and place a breakpoint at GIMP_SFS::d_c. When the plug-in starts, it is stuck executing the do loop. I then use the gdb attach command to attach the PID of the plug-in. Continuing with the gdb c command, it stops at the first breakpoint at GIMP_SFS::d_c. Then I execute the set command: s d_l=0, then continue the application, using appropriate breakpoints as necessary.
This may not answer your question correctly, but shows an alternative method to debugging an otherwise undebugable program.
event <eve...@gm...> wrote:
Hello,
my build process do not produce Windows-executable, but i want to
debug it :). I use alternative debugger which is modified gdb, thus
all the features are supported but run command differs. So i want ot
override debugger run command. I call debugger now through Tools but
it isn't so good.
Thank you for help
--
BR,
event
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
Alfred P. Reaud
|