From: Keith Seitz Date: Mon, 24 Jun 2002 23:59:58 +0000 (+0000) Subject: * Makefile.in (interps.o): Add gdb-events.h as a dependency. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e25496ffcdf1c49a4ce3725837d5d44f5b60bd79;p=thirdparty%2Fbinutils-gdb.git * Makefile.in (interps.o): Add gdb-events.h as a dependency. * gdb-events.sh (clear_gdb_event_hooks): New function. * gdb-events.c: Regenerate. * gdb-events.h: Regenerate. * cli-out.h (cli_out_set_stream): New function. * cli-out.c (cli_out_set_stream): New function. * interps.c: Include gdb-events.h. (clear_interpreter_hooks): Also clear out event handlers. (gdb_set_interpreter): Clear out any hooks/event handlers that may have been installed by old interpreter. * cli/cli-interp.c (cli_interpreter_exec): Set the stream for the cli's uiout to gdb_stdout, which has probably changed from it's initialization. Restore the original stream when we're done executing in the interpreter. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b8be9419760..a7b5da21024 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,24 @@ +2002-06-24 Keith Seitz + + * Makefile.in (interps.o): Add gdb-events.h as a dependency. + + * gdb-events.sh (clear_gdb_event_hooks): New function. + * gdb-events.c: Regenerate. + * gdb-events.h: Regenerate. + + * cli-out.h (cli_out_set_stream): New function. + * cli-out.c (cli_out_set_stream): New function. + + * interps.c: Include gdb-events.h. + (clear_interpreter_hooks): Also clear out event handlers. + (gdb_set_interpreter): Clear out any hooks/event handlers that + may have been installed by old interpreter. + + * cli/cli-interp.c (cli_interpreter_exec): Set the stream for the + cli's uiout to gdb_stdout, which has probably changed from it's + initialization. Restore the original stream when we're done executing + in the interpreter. + 2002-06-18 Keith Seitz * breakpoint.c (internal_breakpoint_number): Make static global. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index f854136418b..7aa5b994fd9 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -2323,8 +2323,8 @@ gdb-events.o: gdb-events.c $(gdb_events_h) $(defs_h) $(gdbcmd_h) ui-out.o: ui-out.c $(defs_h) $(ui_out_h) $(expression_h) $(language_h) cli-out.o: cli-out.c $(defs_h) $(ui_out_h) $(cli_out_h) $(interps_h) -inters.o: interps.c $(defs_h) $(gdbcmd_h) $(ui_out_h) $(event_loop_h) \ - $(event_top_h) $(interps_h) $(gdb_h) $(wrapper_h) +interps.o: interps.c $(defs_h) $(gdbcmd_h) $(ui_out_h) $(event_loop_h) \ + $(event_top_h) $(interps_h) $(gdb_h) $(wrapper_h) $(gdb_events_h) varobj.o: varobj.c $(defs_h) $(frame_h) $(value_h) \ $(language_h) $(valprint_h) $(varobj_h) $(wrapper_h) diff --git a/gdb/cli-out.c b/gdb/cli-out.c index bd079f250bb..e3b45cdd538 100644 --- a/gdb/cli-out.c +++ b/gdb/cli-out.c @@ -365,6 +365,15 @@ cli_out_new (struct ui_file *stream) return ui_out_new (&cli_ui_out_impl, data, flags); } +struct ui_file * +cli_out_set_stream (struct ui_out *uiout, struct ui_file *stream) +{ + struct ui_out_data *data = ui_out_data (uiout); + struct ui_file *old = data->stream; + data->stream = stream; + return old; +} + /* standard gdb initialization hook */ void _initialize_cli_out (void) diff --git a/gdb/cli-out.h b/gdb/cli-out.h index 723b7260cbf..90fd446bbba 100644 --- a/gdb/cli-out.h +++ b/gdb/cli-out.h @@ -23,5 +23,6 @@ #define CLI_OUT_H extern struct ui_out *cli_out_new (struct ui_file *stream); - +extern struct ui_file *cli_out_set_stream (struct ui_out *uiout, + struct ui_file *stream); #endif diff --git a/gdb/gdb-events.c b/gdb/gdb-events.c index ada30a3ef5a..0912e651190 100644 --- a/gdb/gdb-events.c +++ b/gdb/gdb-events.c @@ -134,6 +134,14 @@ set_gdb_event_hooks (struct gdb_events *vector) } #endif +#if WITH_GDB_EVENTS +void +clear_gdb_event_hooks (void) +{ + set_gdb_event_hooks (&null_event_hooks); +} +#endif + enum gdb_event { breakpoint_create, diff --git a/gdb/gdb-events.h b/gdb/gdb-events.h index 5f7fc6b5a55..67868184b0f 100644 --- a/gdb/gdb-events.h +++ b/gdb/gdb-events.h @@ -105,6 +105,9 @@ extern struct gdb_events *set_gdb_event_hooks (struct gdb_events *vector); /* Deliver any pending events. */ extern void gdb_events_deliver (struct gdb_events *vector); +/* Clear event handlers */ +extern void clear_gdb_event_hooks (void); + #if !WITH_GDB_EVENTS #define set_gdb_events(x) 0 #define set_gdb_event_hooks(x) 0 diff --git a/gdb/gdb-events.sh b/gdb/gdb-events.sh index 9965f05577f..2872b99c48c 100755 --- a/gdb/gdb-events.sh +++ b/gdb/gdb-events.sh @@ -267,6 +267,9 @@ extern struct gdb_events *set_gdb_event_hooks (struct gdb_events *vector); /* Deliver any pending events. */ extern void gdb_events_deliver (struct gdb_events *vector); +/* Clear event handlers */ +extern void clear_gdb_event_hooks (void); + #if !WITH_GDB_EVENTS #define set_gdb_events(x) 0 #define set_gdb_event_hooks(x) 0 @@ -393,6 +396,18 @@ cat <procs.resume_proc != NULL && (!interp->procs.resume_proc (interp->data))) { @@ -460,6 +464,7 @@ clear_interpreter_hooks () error_hook = 0; error_begin_hook = 0; command_loop_hook = 0; + clear_gdb_event_hooks (); } /* This is a lazy init routine, called the first time