|
From: Jeremy B. <je...@de...> - 2003-10-25 13:11:55
|
Background: I came to mingw from the NeXT compiler. NeXT's version of gdb had a feature called future-break, which was real handy, it would let you set a breakpoint in a dll and then it would hold it until the dll loaded and then set the breakpoint. My problem is that I have some dll functions that I need to break on, but since the dll's are runtime loaded, I can't set the breakpoint on them until it's too late, and with the state of ctrl-c handling in gdb, it wasn't likely that I was able to catch it in time. Here is my solution: Ok, imagine I have a program called main, and a dll called debug, and a dll called runtimecode. My debug dll has one function which is called breakpoint. It is a empty function that does nothing. Main links against debug-dll at compile time, but loads runtimecode using LoadLibrary(). So in my .gdbinit I have this code: b main comm b debugging.c:breakpoint c end The runtimecode dll also links against the debug-dll at compile time, and whenever I need to stop somewhere I just add a call to the breakpoint() function. It works good for me, but I still wish we had a future-break function, and I wish that breakpoints in dll's would stick around after stopping and re-running the program. I also wish that you could nest the "command" command in gdb, but alas you cannot. ----- Original Message ----- From: "Duncan Murdoch" <mi...@mu...> To: <min...@li...> Sent: Thursday, October 23, 2003 9:33 AM Subject: [Mingw-users] Trap to the debugger? > Is there a simple function or macro to put into code to trap to the > debugger (using Insight on top of gdb)? > > I've tried DebugBreak (a windows.h function), but it traps first > somewhere in the Windows library, and I need to single step to get > into my own code. I'd like Insight to stop right on the source line > that asked for the trap. > > Duncan Murdoch > > > ------------------------------------------------------- > This SF.net email is sponsored by: The SF.net Donation Program. > Do you like what SourceForge.net is doing for the Open > Source Community? Make a contribution, and help us add new > features and functionality. Click here: http://sourceforge.net/donate/ > _______________________________________________ > MinGW-users mailing list > Min...@li... > > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users > |