From 683f2885af8be6282b3a89b77b0bf06a616c0040 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 14 Mar 2008 17:21:08 +0000 Subject: Implement MI notification for new threads. * doc/observer.texi (new_thread): Document. * observer.sh: Forward declare struct thread_info. * thread.c (add_thread): Notify observer. * interps.h (interp_init_ftype): New parameter top_level. (interp_set): Likewise. (top_level_interpreter_data): Declare. * interps.c (interp_set): New parameter top_level. Pass it to interpreter's init function. Remember top level interpreter. (interpreter_exec_cmd): Adjust. (top_level_interpreter_data): New. * main.c (captured_main): Pass 1 for top_level parameter of interp_set. * cli/cli-interp.c (cli_interpreter_init): New parameter top_level. * tui/tui-interp.c (tui_init): New parameter top_level. * mi/mi-interp.c (mi_new_thread): New. (mi_interpreter_init): If top level, register observer for new threads. * Makefile.in (mi-interp.o, thread.o): Update dependencies. --- gdb/interps.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gdb/interps.h') diff --git a/gdb/interps.h b/gdb/interps.h index e1286be..e1030fa 100644 --- a/gdb/interps.h +++ b/gdb/interps.h @@ -35,7 +35,7 @@ extern struct gdb_exception interp_exec (struct interp *interp, const char *command); extern int interp_quiet_p (struct interp *interp); -typedef void *(interp_init_ftype) (void); +typedef void *(interp_init_ftype) (int top_level); typedef int (interp_resume_ftype) (void *data); typedef int (interp_suspend_ftype) (void *data); typedef int (interp_prompt_p_ftype) (void *data); @@ -57,13 +57,15 @@ extern struct interp *interp_new (const char *name, void *data, struct ui_out *uiout, const struct interp_procs *procs); extern void interp_add (struct interp *interp); -extern int interp_set (struct interp *interp); +extern int interp_set (struct interp *interp, int top_level); extern struct interp *interp_lookup (const char *name); extern struct ui_out *interp_ui_out (struct interp *interp); extern int current_interp_named_p (const char *name); extern int current_interp_display_prompt_p (void); extern void current_interp_command_loop (void); +/* Returns opaque data associated with the top-level interpreter. */ +extern void *top_level_interpreter_data (void); extern void clear_interpreter_hooks (void); -- cgit v1.1