Community
Participate
Working Groups
Currently, the Spawner code is limited when interrupting a process in another console. It has to simulate a CTRL-C via keyboard events. Not only is it complicated, but it will only work if that process has a dedicated console. Pedro Alves revealed to us that we can use DebugBreakProcess instead. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=304096#c60 It's available in XP and beyond. I've updated the Spawner raise() method to use this if it's available. What this means is that a CDT debugger user can now interrupt an attached-to process without having to launch the program using 'start myprogram.exe'. Note that even the use of DebugBreakProcess will eventually becomes unnecessary-- when we stop supporting gdb's < 7.0. With 7.0, we can simply interrupt gdb itself and gdb takes care of interrupting the inferior.
Created attachment 166614 [details] Fix Fix. Note that though the suggestion to use DebugBreakProcess came from an engineer at CodeSourcery, stating they use the function in gdb, I did not look at any such GPL code. This simple patch was written 100% from scratch using nothing but MSDN documentation as a reference.
Committed to HEAD. Doug, please review.
*** cdt cvs genie on behalf of jcortell *** Bug 311182: Enhance Spawner JNI code to use DebugBreakProcess when running on >= XP [*] raise.c 1.9 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.core.win32/library/raise.c?root=Tools_Project&r1=1.8&r2=1.9 [*] spawner.dll 1.32 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.core.win32/os/win32/x86/spawner.dll?root=Tools_Project&r1=1.31&r2=1.32