server: Use the standard suspend mechanism to simulate a breakpoint
in an active process, instead of sending a SIGTRAP.
diff --git a/server/process.c b/server/process.c
index 7f7219a..e82cc38 100644
--- a/server/process.c
+++ b/server/process.c
@@ -683,6 +683,28 @@
}
+/* trigger a breakpoint event in a given process */
+void break_process( struct process *process )
+{
+ struct thread *thread;
+
+ suspend_process( process );
+
+ LIST_FOR_EACH_ENTRY( thread, &process->thread_list, struct thread, proc_entry )
+ {
+ if (thread->context) /* inside an exception event already */
+ {
+ break_thread( thread );
+ goto done;
+ }
+ }
+ if ((thread = get_process_first_thread( process ))) thread->debug_break = 1;
+ else set_error( STATUS_ACCESS_DENIED );
+done:
+ resume_process( process );
+}
+
+
/* detach a debugger from all its debuggees */
void detach_debugged_processes( struct thread *debugger )
{