From 29f49a6a4f3f165090de6c85fdb0f29dcb579ae7 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Sun, 18 Jan 2009 17:42:16 +0000 Subject: PR gdb/9747: * gdbthread.h (finish_thread_state, finish_thread_state_cleanup): Declare. * thread.c (finish_thread_state, finish_thread_state_cleanup): New. * infrun.c (wait_for_inferior, fetch_inferior_event): If an error is thrown while handling an event, finish the thread state. (normal_stop): Use finish_thread_state cleanup. * infcmd.c (run_command_1): If an error is thrown while starting the inferior, finish the thread state. --- gdb/gdbthread.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'gdb/gdbthread.h') diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index ab952471..3a405a8 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -288,6 +288,23 @@ extern void set_executing (ptid_t ptid, int executing); /* Reports if thread PTID is executing. */ extern int is_executing (ptid_t ptid); +/* Merge the executing property of thread PTID over to its thread + state property (frontend running/stopped view). + + "not executing" -> "stopped" + "executing" -> "running" + "exited" -> "exited" + + If PIDGET (PTID) is -1, go over all threads. + + Notifications are only emitted if the thread state did change. */ +extern void finish_thread_state (ptid_t ptid); + +/* Same as FINISH_THREAD_STATE, but with an interface suitable to be + registered as a cleanup. PTID_P points to the ptid_t that is + passed to FINISH_THREAD_STATE. */ +extern void finish_thread_state_cleanup (void *ptid_p); + /* Commands with a prefix of `thread'. */ extern struct cmd_list_element *thread_cmd_list; -- cgit v1.1