Commit Graph

48 Commits

Author SHA1 Message Date
Pedro Alves eaae60fd94 Only send sync execution command output to the UI that ran the command
Currently when a "step", "next", etc. finishes, the current source
line is printed on all console UIs.

This patch makes the CLI and TUI interpreters reuse MI's logic to only
emit console output related to a synchronous command on the
console-like interpreter that started the command in the first place.

gdb/ChangeLog:
2016-06-21  Pedro Alves  <palves@redhat.com>

	* cli/cli-interp.c (cli_on_normal_stop): Bail out early if there's
	nothing to print.  Use should_print_stop_to_console.
	* tui/tui-interp.c (tui_on_normal_stop): Likewise.
2016-06-21 01:11:53 +01:00
Pedro Alves b2d86570b3 Simplify starting the command event loop
All interpreter types (CLI/TUI/MI) print the prompt, and then call
start_event_loop.

Because we'll need an interpreter hook to display the
interpreter-specific prompt before going back to the event loop,
without actually starting an event loop, this patch moves the
start_event_loop call to common code, and replaces the command_loop
hook with a pre_command_look hook, that now just prints the prompt.

Turns out to be a cleanup on its own right anyway.

gdb/ChangeLog:
2016-06-21  Pedro Alves  <palves@redhat.com>

	* cli/cli-interp.c (cli_interpreter_pre_command_loop): New
	function.
	(cli_interp_procs): Install it instead of cli_command_loop.
	* cli/cli-interp.h (cli_interpreter_pre_command_loop): Declare.
	* event-top.c (cli_command_loop): Delete.
	* interps.c (interp_new): Remove reference to command_loop_proc.
	(current_interp_command_loop): Delete.
	(interp_pre_command_loop): New function.
	(interp_command_loop_ftype): Delete.
	* interps.h (interp_pre_command_loop_ftype): New typedef.
	(struct interp_procs) <command_loop_proc>: Delele field.
	<pre_command_loop_proc>: New field.
	(current_interp_command_loop): Delete declaration.
	(interp_pre_command_loop): New declaration.
	* main.c (captured_command_loop): Call interp_pre_command_loop
	instead of current_interp_command_loop and start an event loop.
	* mi/mi-interp.c (mi_command_loop): Delete.
	(mi_interpreter_pre_command_loop): New.
	(mi_interp_procs): Update.
	* tui/tui-interp.c (tui_interp_procs): Install
	cli_interpreter_pre_command_loop instead of cli_command_loop.
2016-06-21 01:11:51 +01:00
Pedro Alves 3c216924d6 Make command line editing (use of readline) be per UI
Due to the way that readline's API works (based on globals), we can
only have one instance of readline in a process.  So the goal of this
patch is to only allow editing in the main UI, and make sure that only
one UI calls into readline.  Some MI paths touch readline variables
currently, which is bad as that is changing variables that matter for
the main console UI.  This patch fixes those.

This actually fixes a nasty bug -- starting gdb in MI mode ("gdb
-i=mi"), and then doing "set editing on" crashes GDB, because MI is
not prepared to use readline:

 set editing on
 &"set editing on\n"
 =cmd-param-changed,param="editing",value="on"
 ^done
 (gdb)
 p 1
 readline: readline_callback_read_char() called with no handler!
 Aborted (core dumped)

The fix for that was to add an interp_proc method to query the
interpreter whether it actually supports editing.  New test included.

gdb/ChangeLog:
2016-06-21  Pedro Alves  <palves@redhat.com>

	PR mi/20034
	* cli/cli-interp.c: Include cli-interp.h and event-top.h.
	(cli_interpreter_resume): Pass 1 to gdb_setup_readline.  Set the
	UI's input_handler here.
	(cli_interpreter_supports_command_editing): New function.
	(cli_interp_procs): Install it.
	* cli/cli-interp.h: New file.
	* event-top.c (async_command_editing_p): Rename to ...
	(set_editing_cmd_var): ... this.
	(change_line_handler): Add parameter 'editing', and use it.  Bail
	early if the interpreter doesn't support editing.  Don't touch
	readline state if editing is off.
	(gdb_rl_callback_handler_remove, gdb_rl_callback_handler_install)
	(gdb_rl_callback_handler_reinstall): Assert the current UI is the
	main UI.
	(display_gdb_prompt): Don't call gdb_rl_callback_handler_remove if
	not using readline.  Check whether the current UI is using command
	editing instead of checking the async_command_editing_p global.
	(set_async_editing_command): Delete.
	(gdb_setup_readline): Add 'editing' parameter.  Only allow editing
	on the main UI.  Don't touch readline state if editing is off.
	(gdb_disable_readline): Don't touch readline state if editing is
	off.
	* event-top.h (gdb_setup_readline): Add 'int' parameter.
	(set_async_editing_command): Delete declaration.
	(change_line_handler, command_line_handler): Declare.
	(async_command_editing_p): Rename to ...
	(set_editing_cmd_var): ... this.
	* infrun.c (reinstall_readline_callback_handler_cleanup): Check
	whether the current UI has editing enabled rather than checking
	the async_command_editing_p global.
	* interps.c (interp_supports_command_editing): New function.
	* interps.h (interp_supports_command_editing_ftype): New typedef.
	(struct interp_procs) <supports_command_editing_proc>: New field.
	(interp_supports_command_editing): Declare.
	* mi/mi-interp.c (mi_interpreter_resume): Pass 0 to
	gdb_setup_readline.  Don't clear the async_command_editing_p
	global.  Update comments.
	* top.c (gdb_readline_wrapper_line, gdb_readline_wrapper): Check
	whether the current UI has editing enabled rather than checking
	the async_command_editing_p global.  Don't touch readline state if
	editing is off.
	(undo_terminal_modifications_before_exit): Switch to the main UI.
	Unconditionally call gdb_disable_readline.
	(set_editing): New function.
	(show_async_command_editing_p): Rename to ...
	(show_editing): ... this.  Show the state of the current UI.
	(_initialize_top): Adjust.
	* top.h (struct ui) <command_editing>: New field.
	* tui/tui-interp.c: Include cli/cli-interp.h.
	(tui_resume): Pass 1 to gdb_setup_readline.  Set the UI's
	input_handler.
	(tui_interp_procs): Install
	cli_interpreter_supports_command_editing.
	* tui/tui-io.c (tui_getc): Check whether the current UI has
	editing enabled rather than checking the async_command_editing_p
	global.

gdb/testsuite/ChangeLog:
2016-06-21  Pedro Alves  <palves@redhat.com>

	PR mi/20034
	* gdb.mi/mi-editing.exp: New file.
2016-06-21 01:11:48 +01:00
Pedro Alves 73ab01a07d Make the intepreters output to all UIs
When we have multiple consoles, MI channels, etc., then we need to
broadcast breakpoint hits, etc. to all UIs.  In the past, I've
adjusted most of the run control to communicate events to the
interpreters through observer notifications, so events would be
properly sent to console and MI streams, in sync and async modes.

This patch does the next logical step -- have each interpreter's
observers output interpreter-specific info to _all_ UIs.

Note that when we have multiple instances of active cli/tui
interpreters, then the cli_interp and tui_interp globals no longer
work.  This is addressed by this patch.

Also, the interpreters currently register some observers when resumed
and remove them when suspended.  If we have multiple instances of the
interpreters, and they can be suspended/resumed at different,
independent times, that no longer works.  What we instead do is always
install the observers, and then have the observers themselves know
when to do nothing.

An earlier prototype of this series did the looping over struct UIs in
common code, and then dispatched events to the interpreters through a
matching interp_on_foo method for each observer.  That turned out a
lot more complicated than the present solution, as we'd end up with
having to create a new interp method every time some interpreter
wanted to listen to some observer notification, resulting in a lot of
duplicated make-work and more coupling than desirable.

gdb/ChangeLog:
2016-06-21  Pedro Alves  <palves@redhat.com>

	* cli/cli-interp.c (cli_interp): Delete.
	(as_cli_interp): New function.
	(cli_on_normal_stop, cli_on_signal_received)
	(cli_on_end_stepping_range, cli_on_signal_exited, cli_on_exited)
	(cli_on_no_history): Send output to all CLI UIs.
	(cli_on_sync_execution_done, cli_on_command_error): Skip output if
	the top level interpreter is not a CLI.
	(cli_interpreter_init): Don't set cli_interp or install observers
	here.
	(_initialize_cli_interp): Install observers here.
	* event-top.c (main_ui_, ui_list): New globals.
	(current_ui): Point to main_ui_.
	(restore_ui_cleanup, switch_thru_all_uis_init)
	(switch_thru_all_uis_cond, switch_thru_all_uis_next): New
	functions.
	* mi/mi-interp.c (as_mi_interp): New function.
	(mi_interpreter_init): Don't install observers here.
	(mi_on_sync_execution_done): Skip output if the top level
	interpreter is not a MI.
	(mi_new_thread, mi_thread_exit, mi_record_changed)
	(mi_inferior_added, mi_inferior_appeared, mi_inferior_exit)
	(mi_inferior_removed): Send output to all MI UIs.
	(find_mi_interpreter, mi_interp_data): Delete.
	(find_mi_interp): New function.
	(mi_on_signal_received, mi_on_end_stepping_range)
	(mi_on_signal_exited, mi_on_exited, mi_on_no_history): Send output
	to all MI UIs.
	(mi_on_normal_stop): Rename to ...
	(mi_on_normal_stop_1): ... this.
	(mi_on_normal_stop): Reimplement, sending output to all MI UIs.
	(mi_traceframe_changed, mi_tsv_created, mi_tsv_deleted)
	(mi_tsv_modified, mi_breakpoint_created, mi_breakpoint_deleted)
	(mi_breakpoint_modified, mi_output_running_pid): Send output to
	all MI UIs.
	(mi_on_resume): Rename to ...
	(mi_on_resume_1): ... this.  Don't handle infcalls here.
	(mi_on_resume): Reimplement, sending output to all MI UIs.
	(mi_solib_loaded, mi_solib_unloaded, mi_command_param_changed)
	(mi_memory_changed): Send output to all MI UIs.
	(report_initial_inferior): Install observers here.
	* top.h (struct ui) <next>: New field.
	(ui_list): Declare.
	(struct switch_thru_all_uis): New.
	(switch_thru_all_uis_init, switch_thru_all_uis_cond)
	(switch_thru_all_uis_next): Declare.
	(SWITCH_THRU_ALL_UIS): New macro.
	* tui/tui-interp.c (tui_interp): Delete global.
	(as_tui_interp): New function.
	(tui_on_normal_stop, tui_on_signal_received)
	(tui_on_end_stepping_range, tui_on_signal_exited, tui_on_exited)
	(tui_on_no_history): Send output to all TUI UIs.
	(tui_on_sync_execution_done, tui_on_command_error): Skip output if
	the top level interpreter is not a TUI.
	(tui_init): Don't set tui_interp or install observers here.
	(_initialize_tui_interp): Install observers here.
2016-06-21 01:11:45 +01:00
Pedro Alves 8322445e05 Introduce interpreter factories
If every UI instance has its own set of interpreters, then the current
scheme of creating the interpreters at GDB initialization time no
longer works.  We need to create them whenever a new UI instance is
created.

The scheme implemented here has each interpreter register a factory
callback that when called creates a new instance of a specific
interpreter type.  Then, when some code in gdb looks up an interpreter
(always by name), if there's none yet, the factory method is called to
construct one.

gdb/ChangeLog:
2016-06-21  Pedro Alves  <palves@redhat.com>

	* cli/cli-interp.c (cli_uiout): Delete, moved into ...
	(struct cli_interp): ... this new structure.
	(cli_on_normal_stop, cli_on_signal_received)
	(cli_on_end_stepping_range, cli_on_signal_exited, cli_on_exited)
	(cli_on_no_history): Use interp_ui_out.
	(cli_interpreter_init): If top level, set the cli_interp global.
	(cli_interpreter_init): Return the interp's data instead of NULL.
	(cli_interpreter_resume, cli_interpreter_exec, cli_ui_out): Adjust
	to cli_uiout being in the interpreter's data.
	(cli_interp_procs): New, factored out from _initialize_cli_interp.
	(cli_interp_factory): New function.
	(_initialize_cli_interp): Call interp_factory_register.
	* interps.c (get_interp_info): New, factored out from ...
	(get_current_interp_info): ... this.
	(interp_new): Add parameter 'data'.  Store it.
	(struct interp_factory): New function.
	(interp_factory_p): New typedef.  Define a VEC_P.
	(interpreter_factories): New global.
	(interp_factory_register): New function.
	(interp_add): Add 'ui' parameter.  Use get_interp_info and
	interp_lookup_existing.
	(interp_lookup): Rename to ...
	(interp_lookup_existing): ... this.  Add 'ui' parameter.  Don't
	check for NULL or empty name here.
	(interp_lookup): Add 'ui' parameter and reimplement.
	(interp_set_temp, interpreter_exec_cmd): Adjust.
	(interpreter_completer): Complete on registered interpreter
	factories instead of interpreters.
	* interps.h (interp_factory_func): New typedef.
	(interp_factory_register): Declare.
	(interp_new, interp_add): Adjust.
	(interp_lookup): Declare.
	* main.c (captured_main): Adjust.
	* mi/mi-interp.c (mi_cmd_interpreter_exec): Adjust.
	(mi_interp_procs): New, factored out from
	_initialize_mi_interp.
	(mi_interp_factory): New function.
	* python/python.c (execute_gdb_command): Adjust.
	* tui/tui-interp.c (tui_init): If top level, set the tui_interp
	global.
	(tui_interp_procs): New.
	(tui_interp_factory): New function.
	(_initialize_tui_interp): Call interp_factory_register.
2016-06-21 01:11:45 +01:00
Joel Brobecker 618f726fcb GDB copyright headers update after running GDB's copyright.py script.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2016-01-01 08:43:22 +04:00
Pedro Alves 243a925328 Replace "struct continuation" mechanism by something more extensible
This adds an object oriented replacement for the "struct continuation"
mechanism, and converts the stepping commands (step, next, stepi,
nexti) and the "finish" commands to use it.

It adds a new thread "class" (struct thread_fsm) that contains the
necessary info and callbacks to manage the state machine of a thread's
execution command.

This allows getting rid of some hacks.  E.g., in fetch_inferior_event
and normal_stop we no longer need to know whether a thread is doing a
multi-step (e.g., step N).  This effectively makes the
intermediate_continuations unused -- they'll be garbage collected in a
separate patch.  (They were never a proper abstraction, IMO.  See how
fetch_inferior_event needs to check step_multi before knowing whether
to call INF_EXEC_CONTINUE or INF_EXEC_COMPLETE.)

The target async vs !async uiout hacks in mi_on_normal_stop go away
too.

print_stop_event is no longer called from normal_stop.  Instead it is
now called from within each interpreter's normal_stop observer.  This
clears the path to make each interpreter print a stop event the way it
sees fit.  Currently we have some hacks in common code to
differenciate CLI vs TUI vs MI around this area.

The "finish" command's FSM class stores the return value plus that
value's position in the value history, so that those can be printed to
both MI and CLI's streams.  This fixes the CLI "finish" command when
run from MI -- it now also includes the function's return value in the
CLI stream:

  (gdb)
  ~"callee3 (strarg=0x400730 \"A string argument.\") at src/gdb/testsuite/gdb.mi/basics.c:35\n"
  ~"35\t}\n"
 +~"Value returned is $1 = 0\n"
  *stopped,reason="function-finished",frame=...,gdb-result-var="$1",return-value="0",thread-id="1",stopped-threads="all",core="0"
 -FAIL: gdb.mi/mi-cli.exp: CLI finish: check CLI output
 +PASS: gdb.mi/mi-cli.exp: CLI finish: check CLI output

gdb/ChangeLog:
2015-09-09  Pedro Alves  <palves@redhat.com>

	* Makefile.in (COMMON_OBS): Add thread-fsm.o.
	* breakpoint.c (handle_jit_event): Print debug output.
	(bpstat_what): Split event callback handling to ...
	(bpstat_run_callbacks): ... this new function.
	(momentary_bkpt_print_it): No longer handle bp_finish here.
	* breakpoint.h (bpstat_run_callbacks): Declare.
	* gdbthread.h (struct thread_info) <step_multi>: Delete field.
	<thread_fsm>: New field.
	(thread_cancel_execution_command): Declare.
	* infcmd.c: Include thread-fsm.h.
	(struct step_command_fsm): New.
	(step_command_fsm_ops): New global.
	(new_step_command_fsm, step_command_fsm_prepare): New functions.
	(step_1): Adjust to use step_command_fsm_prepare and
	prepare_one_step.
	(struct step_1_continuation_args): Delete.
	(step_1_continuation): Delete.
	(step_command_fsm_should_stop): New function.
	(step_once): Delete.
	(step_command_fsm_clean_up, step_command_fsm_async_reply_reason)
	(prepare_one_step): New function, based on step_once.
	(until_next_command): Remove step_multi reference.
	(struct return_value_info): New.
	(print_return_value): Rename to ...
	(print_return_value_1): ... this.  New struct return_value_info
	parameter.  Adjust.
	(print_return_value): Reimplement as wrapper around
	print_return_value_1.
	(struct finish_command_fsm): New.
	(finish_command_continuation): Delete.
	(finish_command_fsm_ops): New global.
	(new_finish_command_fsm, finish_command_fsm_should_stop): New
	functions.
	(finish_command_fsm_clean_up, finish_command_fsm_return_value):
	New.
	(finish_command_continuation_free_arg): Delete.
	(finish_command_fsm_async_reply_reason): New.
	(finish_backward, finish_forward): Change symbol parameter to a
	finish_command_fsm.  Adjust.
	(finish_command): Create a finish_command_fsm.  Adjust.
	* infrun.c: Include "thread-fsm.h".
	(clear_proceed_status_thread): Delete the thread's FSM.
	(infrun_thread_stop_requested_callback): Cancel the thread's
	execution command.
	(clean_up_just_stopped_threads_fsms): New function.
	(fetch_inferior_event): Handle the event_thread's should_stop
	method saying the command isn't done yet.
	(process_event_stop_test): Run breakpoint callbacks here.
	(print_stop_event): Rename to ...
	(print_stop_location): ... this.
	(restore_current_uiout_cleanup): New function.
	(print_stop_event): Reimplement.
	(normal_stop): No longer notify the end_stepping_range observers
	here handle "step N" nor "finish" here.  No longer call
	print_stop_event here.
	* infrun.h (struct return_value_info): Forward declare.
	(print_return_value): Declare.
	(print_stop_event): Change prototype.
	* thread-fsm.c: New file.
	* thread-fsm.h: New file.
	* thread.c: Include "thread-fsm.h".
	(thread_cancel_execution_command): New function.
	(clear_thread_inferior_resources): Call it.
	* cli/cli-interp.c (cli_on_normal_stop): New function.
	(cli_interpreter_init): Install cli_on_normal_stop as normal_stop
	observer.
	* mi/mi-interp.c: Include "thread-fsm.h".
	(restore_current_uiout_cleanup): Delete.
	(mi_on_normal_stop): If the thread has an FSM associated, and it
	finished, ask it for the async-reply-reason to print.  Always call
	print_stop_event here, regardless of the top-level interpreter.
	Check bpstat_what to tell whether an asynchronous breakpoint hit
	triggered.
	* tui/tui-interp.c (tui_on_normal_stop): New function.
	(tui_init): Install tui_on_normal_stop as normal_stop observer.

gdb/testsuite/ChangeLog:
2015-09-09  Pedro Alves  <palves@redhat.com>

	* gdb.mi/mi-cli.exp: Add CLI finish tests.
2015-09-09 18:24:00 +01:00
Joel Brobecker 32d0add0a6 Update year range in copyright notice of all files owned by the GDB project.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2015-01-01 13:32:14 +04:00
Pedro Alves 84eda397bc PR tui/16138, PR tui/17519, and misc failures to initialize the terminal
PR tui/16138 is about failure to initialize curses resulting in GDB
exiting instead of throwing an error.  E.g.:

 $ TERM=foo gdb
 (gdb) layout asm
 Error opening terminal: foo.
 $

The problem is that we're calling initscr to initialize the screen.
As mentioned in
http://pubs.opengroup.org/onlinepubs/7908799/xcurses/initscr.html:

 If errors occur, initscr() writes an appropriate error message to
 standard error and exits.
                    ^^^^^

Instead, we should use newterm:

 "A program that needs an indication of error conditions, so it can
 continue to run in a line-oriented mode if the terminal cannot support
 a screen-oriented program, would also use this function."

After the patch:

 $ TERM=foo gdb -q -nx
 (gdb) layout asm
 Cannot enable the TUI: error opening terminal [TERM=foo]
 (gdb)

And then PR tui/17519 is about GDB not validating whether the terminal
has the necessary capabilities when enabling the TUI.  If one tries to
enable the TUI with TERM=dumb (and e.g., from a shell within emacs),
GDB ends up with a clear screen, the cursor is placed at the
bottom/right corner of the screen, there's no prompt, typing shows no
echo, and there's no indication of what's going on.  c-x,a gets you
out of the TUI, but it's completely non-obvious.

After the patch, we get:

 $ TERM=dumb gdb -q -nx
 (gdb) layout asm
 Cannot enable the TUI: terminal doesn't support cursor addressing [TERM=dumb]
 (gdb)

While at it, I've moved all the tui_allowed_p validation to
tui_enable, and expanded the error messages.  Previously we'd get:

 $ gdb -q -nx -i=mi
 (gdb)
 layout asm
 &"layout asm\n"
 &"TUI mode not allowed\n"
 ^error,msg="TUI mode not allowed"

and:

 $ gdb -q -nx -ex "layout asm" > foo
 TUI mode not allowed

While now we get:

 $ gdb -q -nx -i=mi
 (gdb)
 layout asm
 &"layout asm\n"
 &"Cannot enable the TUI when the interpreter is 'mi'\n"
 ^error,msg="Cannot enable the TUI when the interpreter is 'mi'"
 (gdb)

and:

 $ gdb -q -nx -ex "layout asm" > foo
 Cannot enable the TUI when output is not a terminal

Tested on x86_64 Fedora 20.

gdb/
2014-10-29  Pedro Alves  <palves@redhat.com>

	PR tui/16138
	PR tui/17519
	* tui/tui-interp.c (tui_is_toplevel): Delete global.
	(tui_allowed_p): Delete function.
	* tui/tui.c: Include "interps.h".
	(tui_enable): Don't use tui_allowed_p.  Error out here with
	detailed error messages if the TUI is the top level interpreter,
	or if output is not a terminal.  Use newterm instead of initscr,
	and error out if initializing the terminal fails.  Also error out if
	the terminal doesn't support cursor addressing.
	* tui/tui.h (tui_allowed_p): Delete declaration.
2014-10-29 14:23:57 +00:00
Gary Benson c765fdb902 Remove spurious exceptions.h inclusions
defs.h includes utils.h, and utils.h includes exceptions.h.  All GDB
.c files include defs.h as their first line, so no file other than
utils.h needs to include exceptions.h.  This commit removes all such
inclusions.

gdb/ChangeLog:

	* ada-lang.c: Do not include exceptions.h.
	* ada-valprint.c: Likewise.
	* amd64-tdep.c: Likewise.
	* auto-load.c: Likewise.
	* block.c: Likewise.
	* break-catch-throw.c: Likewise.
	* breakpoint.c: Likewise.
	* btrace.c: Likewise.
	* c-lang.c: Likewise.
	* cli/cli-cmds.c: Likewise.
	* cli/cli-interp.c: Likewise.
	* cli/cli-script.c: Likewise.
	* completer.c: Likewise.
	* corefile.c: Likewise.
	* corelow.c: Likewise.
	* cp-abi.c: Likewise.
	* cp-support.c: Likewise.
	* cp-valprint.c: Likewise.
	* darwin-nat.c: Likewise.
	* dwarf2-frame-tailcall.c: Likewise.
	* dwarf2-frame.c: Likewise.
	* dwarf2loc.c: Likewise.
	* dwarf2read.c: Likewise.
	* eval.c: Likewise.
	* event-loop.c: Likewise.
	* event-top.c: Likewise.
	* f-valprint.c: Likewise.
	* frame-unwind.c: Likewise.
	* frame.c: Likewise.
	* gdbtypes.c: Likewise.
	* gnu-v2-abi.c: Likewise.
	* gnu-v3-abi.c: Likewise.
	* guile/scm-auto-load.c: Likewise.
	* guile/scm-breakpoint.c: Likewise.
	* guile/scm-cmd.c: Likewise.
	* guile/scm-frame.c: Likewise.
	* guile/scm-lazy-string.c: Likewise.
	* guile/scm-param.c: Likewise.
	* guile/scm-symbol.c: Likewise.
	* guile/scm-type.c: Likewise.
	* hppa-hpux-tdep.c: Likewise.
	* i386-tdep.c: Likewise.
	* inf-loop.c: Likewise.
	* infcall.c: Likewise.
	* infcmd.c: Likewise.
	* infrun.c: Likewise.
	* interps.c: Likewise.
	* interps.h: Likewise.
	* jit.c: Likewise.
	* linespec.c: Likewise.
	* linux-nat.c: Likewise.
	* linux-thread-db.c: Likewise.
	* m32r-rom.c: Likewise.
	* main.c: Likewise.
	* memory-map.c: Likewise.
	* mi/mi-cmd-break.c: Likewise.
	* mi/mi-cmd-stack.c: Likewise.
	* mi/mi-interp.c: Likewise.
	* mi/mi-main.c: Likewise.
	* monitor.c: Likewise.
	* nto-procfs.c: Likewise.
	* objc-lang.c: Likewise.
	* p-valprint.c: Likewise.
	* parse.c: Likewise.
	* ppc-linux-tdep.c: Likewise.
	* printcmd.c: Likewise.
	* probe.c: Likewise.
	* python/py-auto-load.c: Likewise.
	* python/py-breakpoint.c: Likewise.
	* python/py-cmd.c: Likewise.
	* python/py-finishbreakpoint.c: Likewise.
	* python/py-frame.c: Likewise.
	* python/py-framefilter.c: Likewise.
	* python/py-function.c: Likewise.
	* python/py-gdb-readline.c: Likewise.
	* python/py-inferior.c: Likewise.
	* python/py-infthread.c: Likewise.
	* python/py-lazy-string.c: Likewise.
	* python/py-linetable.c: Likewise.
	* python/py-param.c: Likewise.
	* python/py-prettyprint.c: Likewise.
	* python/py-symbol.c: Likewise.
	* python/py-type.c: Likewise.
	* python/py-value.c: Likewise.
	* python/python-internal.h: Likewise.
	* python/python.c: Likewise.
	* record-btrace.c: Likewise.
	* record-full.c: Likewise.
	* regcache.c: Likewise.
	* remote-fileio.c: Likewise.
	* remote-mips.c: Likewise.
	* remote.c: Likewise.
	* rs6000-aix-tdep.c: Likewise.
	* rs6000-nat.c: Likewise.
	* skip.c: Likewise.
	* solib-darwin.c: Likewise.
	* solib-dsbt.c: Likewise.
	* solib-frv.c: Likewise.
	* solib-ia64-hpux.c: Likewise.
	* solib-spu.c: Likewise.
	* solib-svr4.c: Likewise.
	* solib.c: Likewise.
	* spu-tdep.c: Likewise.
	* stack.c: Likewise.
	* stap-probe.c: Likewise.
	* symfile-mem.c: Likewise.
	* symmisc.c: Likewise.
	* target.c: Likewise.
	* thread.c: Likewise.
	* top.c: Likewise.
	* tracepoint.c: Likewise.
	* tui/tui-interp.c: Likewise.
	* typeprint.c: Likewise.
	* utils.c: Likewise.
	* valarith.c: Likewise.
	* valops.c: Likewise.
	* valprint.c: Likewise.
	* value.c: Likewise.
	* varobj.c: Likewise.
	* windows-nat.c: Likewise.
	* xml-support.c: Likewise.
2014-10-08 09:33:22 +01:00
Pedro Alves 92bcb5f949 Make display_gdb_prompt CLI-only.
Enabling target-async by default will require implementing sync
execution on top of an async target, much like foreground command are
implemented on the CLI in async mode.

In order to do that, we will need better control of when to print the
MI prompt.  Currently the interp->display_prompt_p hook is all we
have, and MI just always returns false, meaning, make
display_gdb_prompt a no-op.  We'll need to be able to know to print
the MI prompt in some of the conditions that display_gdb_prompt is
called from the core, but not all.

This is all a litte twisted currently.  As we can see,
display_gdb_prompt is really CLI specific, so make the console
interpreters (console/tui) themselves call it.  To be able to do that,
and add a few different observers that the interpreters can use to
distinguish when or why the the prompt is being printed:

#1 - one called whenever a command is cancelled due to an error.
#2 - another for when a foreground command just finished.

In both cases, CLI wants to print the prompt, while MI doesn't.

MI will want to print the prompt in the second case when in a special
MI mode.

The display_gdb_prompt call in interp_set made me pause.  The comment
there reads:

  /* Finally, put up the new prompt to show that we are indeed here.
     Also, display_gdb_prompt for the console does some readline magic
     which is needed for the console interpreter, at least...  */

But, that looks very much like a no-op to me currently:

 - the MI interpreter always return false in the prompt hook, meaning
   actually display no prompt.

 - the interpreter used at that point is still quiet.  And the
   console/tui interpreters return false in the prompt hook if they're
   quiet, meaning actually display no prompt.

The only remaining possible use would then be the readline magic.  But
whatever that might have been, it's not reacheable today either,
because display_gdb_prompt returns early, before touching readline if
the interpreter returns false in the display_prompt_p hook.

Tested on x86_64 Fedora 20, sync and async modes.

gdb/
2014-05-29  Pedro Alves  <palves@redhat.com>

	* cli/cli-interp.c (cli_interpreter_display_prompt_p): Delete.
	(_initialize_cli_interp): Adjust.
	* event-loop.c: Include "observer.h".
	(start_event_loop): Notify 'command_error' observers instead of
	calling display_gdb_prompt.  Remove FIXME comment.
	* event-top.c (display_gdb_prompt): Remove call into the
	interpreters.
	* inf-loop.c: Include "observer.h".
	(inferior_event_handler): Notify 'command_error' observers instead
	of calling display_gdb_prompt.
	* infrun.c (fetch_inferior_event): Notify 'sync_execution_done'
	observers instead of calling display_gdb_prompt.
	* interps.c (interp_set): Don't call display_gdb_prompt.
	(current_interp_display_prompt_p): Delete.
	* interps.h (interp_prompt_p): Delete declaration.
	(interp_prompt_p_ftype): Delete.
	(struct interp_procs) <prompt_proc_p>: Delete field.
	(current_interp_display_prompt_p): Delete declaration.
	* mi-interp.c (mi_interpreter_prompt_p): Delete.
	(_initialize_mi_interp): Adjust.
	* tui-interp.c (tui_init): Install 'sync_execution_done' and
	'command_error' observers.
	(tui_on_sync_execution_done, tui_on_command_error): New
	functions.
	(tui_display_prompt_p): Delete.
	(_initialize_tui_interp): Adjust.

gdb/doc/
2014-05-29  Pedro Alves  <palves@redhat.com>

	* observer.texi (sync_execution_done, command_error): New
	subjects.
2014-05-29 13:47:09 +01:00
Pedro Alves fd664c9176 PR gdb/13860 - Make MI sync vs async output (closer to) the same.
Ignoring expected and desired differences like whether the prompt is
output after *stoppped records, GDB MI output is still different in
sync and async modes.

In sync mode, when a CLI execution command is entered, the "reason"
field is missing in the *stopped async record.  And in async mode, for
some events, like program exits, the corresponding CLI output is
missing in the CLI channel.

Vis, diff between sync vs async modes:

   run
   ^running
   *running,thread-id="1"
   (gdb)
   ...
 - ~"[Inferior 1 (process 15882) exited normally]\n"
   =thread-exited,id="1",group-id="i1"
   =thread-group-exited,id="i1",exit-code="0"
 - *stopped
 + *stopped,reason="exited-normally"

   si
   ...
   (gdb)
   ~"0x000000000045e033\t29\t  memset (&args, 0, sizeof args);\n"
 - *stopped,frame=...,thread-id="1",stopped-threads="all",core="0"
 + *stopped,reason="end-stepping-range",frame=...,thread-id="1",stopped-threads="all",core="0"
   (gdb)

In addition, in both cases, when a MI execution command is entered,
and a breakpoint triggers, the event is sent to the console too.  But
some events like program exits have the CLI output missing in the CLI
channel:

   -exec-run
   ^running
   *running,thread-id="1"
   (gdb)
   ...
   =thread-exited,id="1",group-id="i1"
   =thread-group-exited,id="i1",exit-code="0"
 - *stopped
 + *stopped,reason="exited-normally"

We'll want to make background commands always possible by default.
IOW, make target-async be the default.  But, in order to do that,
we'll need to emulate MI sync on top of an async target.  That means
we'll have yet another combination to care for in the testsuite.

Rather than making the testsuite cope with all these differences, I
thought it better to just fix GDB to always have the complete output,
no matter whether it's in sync or async mode.

This is all related to interpreter-exec, and the corresponding uiout
switching.  (Typing a CLI command directly in MI is shorthand for
running it through -interpreter-exec console.)

In sync mode, when a CLI command is active, normal_stop is called when
the current interpreter and uiout are CLI's.  So print_XXX_reason
prints the stop reason to CLI uiout (only), and we don't show it in
MI.

In async mode the stop event is processed when we're back in the MI
interpreter, so the stop reason is printed directly to the MI uiout.

Fix this by making run control event printing roughly independent of
whatever is the current interpreter or uiout.  That is, move these
prints to interpreter observers, that know whether to print or be
quiet, and if printing, which uiout to print to.  In the case of the
console/tui interpreters, only print if the top interpreter.  For MI,
always print.

Breakpoint hits / normal stops are already handled similarly -- MI has
a normal_stop observer that prints the event to both MI and the CLI,
though that could be cleaned up further in the direction of this
patch.

This also makes all of:

 (gdb) foo
and
 (gdb) interpreter-exec MI "-exec-foo"
and
 (gdb)
 -exec-foo
and
 (gdb)
 -interpreter-exec console "foo"

print as expected.

Tested on x86_64 Fedora 20, sync and async modes.

gdb/
2014-05-29  Pedro Alves  <palves@redhat.com>

	PR gdb/13860
	* cli/cli-interp.c: Include infrun.h and observer.h.
	(cli_uiout, cli_interp): New globals.
	(cli_on_signal_received, cli_on_end_stepping_range)
	(cli_on_signal_exited, cli_on_exited, cli_on_no_history): New
	functions.
	(cli_interpreter_init): Install them as 'end_stepping_range',
	'signal_received' 'signal_exited', 'exited' and 'no_history'
	observers.
	(_initialize_cli_interp): Remove cli_interp local.
	* infrun.c (handle_inferior_event): Call the several stop reason
	observers instead of printing the stop reason directly.
	(end_stepping_range): New function.
	(print_end_stepping_range_reason, print_signal_exited_reason)
	(print_exited_reason, print_signal_received_reason)
	(print_no_history_reason): Make static, and add an uiout
	parameter.  Print to that instead of to CURRENT_UIOUT.
	* infrun.h (print_end_stepping_range_reason)
	(print_signal_exited_reason, print_exited_reason)
	(print_signal_received_reason print_no_history_reason): New
	declarations.
	* mi/mi-common.h (struct mi_interp): Rename 'uiout' field to
	'mi_uiout'.
	<cli_uiout>: New field.
	* mi/mi-interp.c (mi_interpreter_init): Adjust.  Create the new
	uiout for CLI output.  Install 'signal_received',
	'end_stepping_range', 'signal_exited', 'exited' and 'no_history'
	observers.
	(find_mi_interpreter, mi_interp_data, mi_on_signal_received)
	(mi_on_end_stepping_range, mi_on_signal_exited, mi_on_exited)
	(mi_on_no_history): New functions.
	(ui_out_free_cleanup): Delete function.
	(mi_on_normal_stop): Don't allocate a new uiout for CLI output,
	instead use the one already stored in the MI interpreter data.
	(mi_ui_out): Adjust.
	* tui/tui-interp.c: Include infrun.h and observer.h.
	(tui_interp): New global.
	(tui_on_signal_received, tui_on_end_stepping_range)
	(tui_on_signal_exited, tui_on_exited)
	(tui_on_no_history): New functions.
	(tui_init): Install them as 'end_stepping_range',
	'signal_received' 'signal_exited', 'exited' and 'no_history'
	observers.
	(_initialize_tui_interp): Delete tui_interp local.

gdb/doc/
2014-05-29  Pedro Alves  <palves@redhat.com>

	PR gdb/13860
	* observer.texi (signal_received, end_stepping_range)
	(signal_exited, exited, no_history): New observer subjects.

gdb/testsuite/
2014-05-29  Pedro Alves  <palves@redhat.com>

	PR gdb/13860
	* gdb.mi/mi-cli.exp: Always expect "end-stepping-range" stop
	reason, even in sync mode.
2014-05-29 13:09:45 +01:00
Joel Brobecker ecd75fc8ee Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
Andrew Burgess 4d09c5b423 Give every interpreter a command_loop_proc.
https://sourceware.org/ml/gdb-patches/2013-09/msg00179.html

gdb/ChangeLog

        * cli/cli-interp.c (_initialize_cli_interp): Add a
        command_loop_proc to interp_procs.
        * event-top.c (cli_command_loop): Change signature to match
        interp_command_loop_ftype.
        * event-top.h (cli_command_loop): Same.
        * interps.c (interp_new): Require every interpreter to have a
        command_loop_proc.
        (current_interp_command_loop): Just call the command_loop_proc on
        the current interpreter.
        * tui/tui-interp.c (_initialize_tui_interp): Add a
        command_loop_proc to interp_procs.
2013-09-06 08:53:09 +00:00
Joel Brobecker 8acc9f485b Update years in copyright notice for the GDB files.
Two modifications:
  1. The addition of 2013 to the copyright year range for every file;
  2. The use of a single year range, instead of potentially multiple
     year ranges, as approved by the FSF.
2013-01-01 06:41:43 +00:00
Joel Brobecker c5a5708100 Copyright year update in most files of the GDB Project.
gdb/ChangeLog:

        Copyright year update in most files of the GDB Project.
2012-01-04 08:28:28 +00:00
Pedro Alves 4801a9a356 gdb/
2011-09-12  Pedro Alves  <pedro@codesourcery.com>
	    Matt Rice  <ratmice@gmail.com>

	PR gdb/13175

	* interps.c (struct interp) <interpreter_out>: Delete field.
	(interp_new): Remove the data and uiout parameters and adjust.
	(interp_set): Only set the current_uiout from the interpreter's
	uiout after initializing the interpreter.  Adjust call to
	init_proc.
	(interp_ui_out): Adjust to call procs->ui_out_proc.
	(interp_data, interp_name): New.
	* interps.h (interp_init_ftype): Add `self' parameter.
	(interp_ui_out_ftype): New typedef.
	(struct interp_procs) <ui_out_proc>: New method pointer.
	(interp_new): Remove the data and uiout parameters.
	(interp_data, interp_name): Declare.
	* tui/tui-interp.c (tui_init): Adjust prototype.
	(tui_ui_out): New.
	(_initialize_tui_interp): Install tui_ui_out.  Don't instanciate
	tui_out here.  Adjust call to interp_new.
	* tui/tui-io.c (tui_initialize_io): Don't set current_uiout here.
	* cli/cli-interp.c (cli_interpreter_init): Adjust prototype.
	(cli_ui_out): New.
	(_initialize_cli_interp): Install it.  Adjust call to interp_new.
	* mi/mi-common.h (struct mi_interp) <uiout>: New field.
	* mi/mi-interp.c (mi_interpreter_init): Adjust prototype.
	Initialize mi->uiout depending on the mi_version as extracted from
	the interpreter's name.
	(mi_ui_out): New.
	(_initialize_mi_interp): Install mi_ui_out.  Adjust calls to
	interp_new.  Don't allocate the ui_out's of the interpreters here.

gdb/testsuite/
2011-09-12  Matt Rice  <ratmice@gmail.com>
	    Pedro Alves  <pedro@codesourcery.com>

	PR gdb/13175

	* gdb.base/interp.exp: New tests.
	* gdb.base/interp.c: New file.
2011-09-12 21:25:22 +00:00
Pedro Alves e0dd0826e2 2011-08-04 Pedro Alves <pedro@codesourcery.com>
* event-loop.c (gdb_do_one_event): Remove `data' parameter.
	(start_event_loop): Use TRY_CATCH instead of catch_errors.
	* event-loop.h (gdb_do_one_event): Remove `data' parameter.
	* top.c (gdb_readline_wrapper): Adjust.
	* tui/tui-interp.c (tui_command_loop):
	(_initialize_tui_interp): Don't install it.
2011-08-04 20:09:46 +00:00
Pedro Alves 79a45e254f 2011-08-04 Pedro Alves <pedro@codesourcery.com>
* ui-out.h (uiout): Rename to ...
	(current_uiout): ... this.
	* ui-out.c (uiout): Rename to ...
	(current_uiout): ... this.
	* ada-lang.c (print_it_exception, print_one_exception)
	(print_mention_exception): Adjust.
	* breakpoint.c (watchpoint_check): Adjust.
	(print_breakpoint_location, print_one_breakpoint, breakpoint_1)
	(default_collect_info, watchpoints_info, print_one_catch_fork)
	(print_one_catch_vfork, print_one_catch_syscall)
	(print_one_catch_exec, mention, print_it_ranged_breakpoint)
	(print_one_ranged_breakpoint, print_mention_ranged_breakpoint)
	(print_it_watchpoint, print_mention_watchpoint)
	(print_it_masked_watchpoint, print_mention_masked_watchpoint)
	(print_it_exception_catchpoint, print_one_exception_catchpoint)
	(print_mention_exception_catchpoint, say_where, bkpt_print_it)
	(bkpt_print_mention, momentary_bkpt_print_it)
	(tracepoint_print_mention, update_static_tracepoint)
	(tracepoints_info, save_breakpoints): Adjust.
	* cli-out.c (field_separator): Adjust.
	* cp-abi.c (list_cp_abis, show_cp_abi_cmd): Adjust.
	* exceptions.c (catch_exceptions_with_msg, catch_errors): Adjust.
	* frame.c (get_current_frame): Adjust.
	* infcmd.c (run_command_1, print_return_value): Adjust.
	* inferior.c (inferior_command, info_inferiors_command): Adjust.
	* infrun.c (print_end_stepping_range_reason): Adjust.
	(print_signal_exited_reason, print_exited_reason): Adjust.
	(print_signal_received_reason, print_no_history_reason): Adjust.
	* interps.c (interp_set): Adjust.
	* osdata.c (info_osdata_command): Adjust.
	* progspace.c (maintenance_info_program_spaces_command): Adjust.
	* remote-fileio.c (remote_fileio_request): Adjust.
	* remote.c (show_remote_cmd): Adjust.
	* solib.c (info_sharedlibrary_command): Adjust.
	* source.c (print_source_lines_base): Adjust.
	* stack.c (print_stack_frame): Adjust.
	(do_gdb_disassembly, print_frame_info, print_frame): Adjust.
	* symfile-mem.c (add_vsyscall_page): Adjust.
	* symfile.c (load_progress, generic_load)
	(print_transfer_performance): Adjust.
	* thread.c (info_threads_command, restore_selected_frame)
	(thread_command): Adjust.
	* top.c (make_cleanup_restore_ui_file): Adjust.
	* tracepoint.c (tvariables_info_1, trace_status_mi, tfind_1)
	(print_one_static_tracepoint_marker): Adjust.
	* cli/cli-cmds.c (print_disassembly): Adjust.
	* cli/cli-decode.c (print_doc_line): Adjust.
	* cli/cli-interp.c (safe_execute_command): Adjust.
	* cli/cli-logging.c (set_logging_redirect, pop_output_files)
	(handle_redirections): Adjust.
	* cli/cli-script.c (show_user_1): Adjust.
	* cli/cli-setshow.c (do_setshow_command, cmd_show_list): Adjust.
	* mi/mi-cmd-break.c (breakpoint_notify): Adjust.
	* mi/mi-cmd-disas.c (mi_cmd_disassemble): Adjust.
	* mi/mi-cmd-env.c (mi_cmd_env_pwd, mi_cmd_env_path)
	(mi_cmd_env_dir): Adjust.
	* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file)
	(print_partial_file_name, mi_cmd_file_list_exec_source_files): Adjust.
	* mi/mi-cmd-stack.c (mi_cmd_stack_list_frames)
	(mi_cmd_stack_info_depth, mi_cmd_stack_list_args)
	(list_args_or_locals): Adjust.
	* mi/mi-cmd-var.c (print_varobj, mi_cmd_var_create)
	(mi_cmd_var_delete, mi_cmd_var_set_format, mi_cmd_var_set_frozen)
	(mi_cmd_var_show_format, mi_cmd_var_info_num_children)
	(mi_cmd_var_list_children, mi_cmd_var_info_type)
	(mi_cmd_var_info_path_expression, mi_cmd_var_info_expression)
	(mi_cmd_var_show_attributes, mi_cmd_var_evaluate_expression)
	(mi_cmd_var_assign, mi_cmd_var_update, varobj_update_one): Adjust.
	* mi/mi-interp.c (mi_on_normal_stop): Adjust.
	* mi/mi-main.c (mi_cmd_gdb_exit, mi_cmd_thread_select)
	(mi_cmd_thread_list_ids, mi_cmd_thread_info, print_one_inferior)
	(list_available_thread_groups, mi_cmd_list_thread_groups)
	(mi_cmd_data_list_register_names)
	(mi_cmd_data_list_changed_registers)
	(mi_cmd_data_list_register_values, get_register)
	(mi_cmd_data_evaluate_expression, mi_cmd_data_read_memory)
	(mi_cmd_data_read_memory_bytes, mi_cmd_list_features)
	(mi_cmd_list_target_features, mi_cmd_add_inferior)
	(mi_execute_command, mi_load_progress): Adjust.
	* mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Adjust.
	* python/py-auto-load.c (print_script, info_auto_load_scripts):
	Adjust.
	* python/py-breakpoint.c (bppy_get_commands): Adjust.
	* tui/tui-interp.c (tui_command_loop): Adjust.
	* tui/tui-io.c (tui_setup_io, tui_initialize_io): Adjust.
2011-08-04 19:10:14 +00:00
Phil Muldoon 95298e7219 2011-07-22 Phil Muldoon <pmuldoon@redhat.com>
* event-top.c (cli_command_loop): Use get_prompt, get_suffix,
	get_prefix.
	(display_gdb_prompt): Likewise.
	(change_annotation_level): Likewise.
	(push_prompt): Likewise.
	(pop_prompt): Likewise.
	(handle_stop_sig): Use get_prompt with a level.
	* top.c (command_loop): Use get_prompt with a level.
	(set_async_annotation_level): Use set_prompt with a level.
	(get_prefix): New function.
	(set_prefix): Ditto.
	(set_suffix): Ditto.
	(get_suffix): Ditto.
	(get_prompt): Accept a level argument.
	(set_prompt): Accept a level argument.  Free old prompts.  Set
	new_async_prompt if level is 0.
	(init_main): Use set_prompt with a level.  Do not set
	new_async_prompt.
	* event-top.h (PROMPT, SUFFIX, PREFIX): Move to top.c
	* top.h: Declare set_suffix, get_suffix, set_prefix, get_prefix.
	Modify set_prompt, get_prompt to account for levels.
	* tui/tui-interp.c (tui_command_loop): Use get_prompt with a
	level
	* python/python.c (before_prompt_hook): Use set_prompt.
2011-07-22 09:22:50 +00:00
Joel Brobecker 7b6bb8daac run copyright.sh for 2011. 2011-01-01 15:34:07 +00:00
Michael Snyder 1c5313c5c8 2010-05-17 Michael Snyder <msnyder@vmware.com>
* tui/tui.c: White space.
	* tui/tui-data.c: White space.
	* tui/tui-disasm.c: White space.
	* tui/tui-file.c: White space.
	* tui/tui-interp.c: White space.
	* tui/tui-main.c: White space.
	* tui/tui-out.c: White space.
	* tui/tui-regs.c: White space.
	* tui/tui-source.c: White space.
	* tui/tui-stack.c: White space.
	* tui/tui-win.c: White space.
	* tui/tui-winsource.c: White space.
2010-05-17 22:21:43 +00:00
Michael Snyder 0043e6a5cc 2010-05-05 Michael Snyder <msnyder@vmware.com>
* tui/tui-interp.c (_initialize_tui_interp):
	Delete unused variable.
	* tui/tui-regs.c tui_display_registers_from):
	Delete unused variable.
	(tui_check_register_values): Delete unused variable.
	(tui_register_format): Delete unused variable.
	* tui/tui-win.c (_initialize_tui_win): Delete unused variable.
	* tui/tui-windata.c (tui_display_data_from_line):
	Delete unused variables.
	(tui_vertical_data_scroll): Delete unused variables.
2010-05-05 22:53:54 +00:00
Pedro Alves 956c2c8b9a * tui/tui-interp.c (tui_is_toplevel): New.
(tui_init): Set it.
	(tui_allowed_p): New.
	* tui/tui.c (tui_enable): Check if the TUI is allowed before
	enabling it.
	* tui/tui.h (tui_allowed_p): Declare.
2010-03-30 22:21:34 +00:00
H.J. Lu 1180b2c86e Call tui_initialize_readline only if gdb_stdout is a tty.
2010-02-04  H.J. Lu  <hongjiu.lu@intel.com>

	PR tui/9622
	* tui/tui-interp.c (tui_init): Call tui_initialize_readline
	only if gdb_stdout is a tty.
2010-02-04 17:37:59 +00:00
Joel Brobecker 4c38e0a4fc Update copyright year in most headers.
Automatic update by copyright.sh.
2010-01-01 07:32:07 +00:00
Pedro Alves 2c0b251b29 2008-02-21 Pedro Alves <pedro@codesorcery.com>
Silence a few -Wmissing-prototypes warnings.

	PR build/9877:
	* amd64-nat.c: Include "amd64-nat.h".
	* fork-child.c (_initialize_fork_child): Ditto.
	* gcore.c (_initialize_gcore): Ditto.
	* inf-ptrace.c: Include "inf-ptrace.h".
	(inf_ptrace_store_registers): Make it static.
	* linux-nat.c (linux_nat_terminal_ours): Make it static.
	(_initialize_linux_nat): Declare before definition.
	* linux-tdep.c: Include "linux-tdep.h".
	* linux-thread-db.c (_initialize_thread_db): Declare before
	definition.
	* proc-service.c (_initialize_proc_service): Ditto.
	* remote.c (remote_send_printf): Make it static.
	* solib.c: Include "solib.h".
	* symfile-mem.c (_initialize_symfile_mem): Declare before
	definition.
	* ada-lang.c (ada_la_decode, ada_match_name)
	(ada_suppress_symbol_printing, ada_is_array_type)
	(ada_value_ptr_subscript, ada_array_length)
	(ada_to_static_fixed_value): Make them static.
	(_initialize_ada_language): Declare before definition.
	* ada-tasks.c (ada_get_task_number, ada_get_environment_task)
	(ada_task_list_changed, ada_new_objfile_observer): Make them
	static.
	(_initialize_tasks): Declare before definition.
	* addrmap.c (_initialize_addrmap): Declare before definition.
	* auxv.c (default_auxv_parse): Make it static.
	* bfd-target.c (target_bfd_xfer_partial, target_bfd_xclose): Make
	them static.
	* breakpoint.c (remove_sal): Add line break.
	(expand_line_sal_maybe): Make it static.
	* cp-name-parser.y: Include "cp-support.h".
	* cp-valprint.c (cp_find_class_member): Make it static.
	* eval.c (value_f90_subarray): Ditto.
	* exceptions.c (print_any_exception): Ditto.
	* findcmd.c (_initialize_mem_search): Declare before definition.
	* frame.c (frame_observer_target_changed): Make it static.
	* gnu-v3-abi.c (gnuv3_find_method_in): Make it static.
	* inf-child.c: Include "inf-child.h".
	* inferior.h (valid_inferior_id): Rename to ...
	(valid_gdb_inferior_id): ... this.
	* infrun.c (infrun_thread_stop_requested, siginfo_make_value):
	Make them static.
	* jv-lang.c (java_language_arch_info): Make it static.
	* m2-typeprint.c (m2_get_discrete_bounds): Ditto.
	* osdata.c (info_osdata_command): Make it static.
	* regcache.c (regcache_observer_target_changed): Make it static.
	* reverse.c (_initialize_reverse): Declare before definition.
	* stabsread.c (cleanup_undefined_types_noname)
	(cleanup_undefined_types_1): Make them static.
	* symfile.c (place_section): Make it static.
	* symtab.c (find_pc_sect_psymtab_closer): Make it static.
	* target-descriptions.c (_initialize_target_descriptions): Declare
	before definition.
	* target.c (default_get_ada_task_ptid, find_default_can_async_p)
	(find_default_is_async_p, find_default_supports_non_stop): Make
	them static.
	(target_supports_non_stop): Add prototype.
	(dummy_pid_to_str): Make it static.
	* utils.c (_initialize_utils): Declare before definition.
	* ada-exp.y (_initialize_ada_exp): Declare before definition.
	* solib-svr4.c (HAS_LM_DYNAMIC_FROM_LINK_MAP): Add a prototype.
	* target.h (struct target_ops): Add a prototype to the
	to_can_execute_reverse callback.
	* macroscope.c (_initialize_macroscope): Declare before definition.
	* cp-namespace.c (_initialize_cp_namespace): Declare before definition.
	* python/python.c (_initialize_python): Declare before definition.
	* tui/tui-command.c: Include "tui/tui-command.h".
	* tui/tui-data.c (init_content_element, init_win_info): Make them
	static.
	* tui/tui-disasm.c: Include "tui/tui-disasm.h".
	* tui/tui-interp.c (_initialize_tui_interp): Declare before
	definition.
	* tui/tui-layout.c: Include "tui/tui-layout.h".
	(_initialize_tui_layout): Declare before definition.
	* tui/tui-regs.c: Include "tui/tui-regs.h".
	(tui_display_reg_element_at_line): Make it static.
	(_initialize_tui_regs): Declare before definition.
	* tui/tui-stack.c (_initialize_tui_stack): Declare before
	definition.
	* tui/tui-win.c: Include "tui/tui-win.h".
	(_initialize_tui_win): Declare before definition.
	(tui_sigwinch_handler): Make it static.  Wrap in ifdef SIGWINCH.
	* tui/tui-win.h (tui_sigwinch_handler): Delete declaration.
	(tui_get_cmd_list): Add a prototype.
	* tui/tui-windata.c: Include tui-windata.h.
	* tui/tui-wingeneral.c (box_win): Make it static.
	* cli/cli-logging.c (show_logging_command): Make it static.
	(_initialize_cli_logging): Declare before definition.
	* mi/mi-common.c (_initialize_gdb_mi_common): Declare before
	definition.
2009-02-21 16:14:50 +00:00
Joel Brobecker 0fb0cc7590 Updated copyright notices for most files. 2009-01-03 05:58:08 +00:00
Vladimir Prus 712af3be2e * defs.h (do_exec_error_cleanups, discard_exec_error_cleanups)
(make_exec_error_cleanup): Remove declarations.
	* utils.c (exec_error_cleanup_chain): Remove.
	(do_exec_error_cleanups, discard_exec_error_cleanups)
	(make_exec_error_cleanup): Remove.
	* event-loop.c (start_event_loop): Adjust call to
	async_enable_stdin.
	* event-top.c (async_enable_stdin): Remove the paramater dummy.
	(async_disable_stdin): Don't register async_enable_stdin via
	cleanup.
	* inf-loop.c (inferior_event_handler): Don't
	call do_exec_error_cleanups.  Call async_enable_stdin instead.
	* event-loop.c (start_event_loop): Adjust call to
	async_enable_stdin.
	* tui/tui-interp.c (tui_command_loop): Adjust call to
	async_enable_stdin.
2008-03-14 19:55:51 +00:00
Vladimir Prus 32c1e744c1 Async mode fixes.
* Makefile.in (infcmd.o, inf-loop.o): Update dependencies.
        * breakpoint.c (bpstat_do_actions): In async mode,
        don't jump to top expecting stop_bpstat to be already
        updated.
        * event-loop.c (start_event_loop): Call async_enable_stdin
        on exception.
        * event-top.c (async_enable_stdin): Do nothing if sync_execution
        is not set.
        (command_handler): Do not setup continuation here.
        (command_line_handler_continuation): Move to...
        * top.c (command_line_handler_continuation): ... here.
        (execute_command): In async mode, register continuation.
        Don't check frame's language in running in async mode.
        * exceptions.c (throw_exception): Don't do exec_error_cleanups.
        * inf-loop.c (complete_execution): Inline into...
        (inferior_event_handler): ... here.  Clear target_executing before
        doing any cleanups.  Don't try to show prompt if the target was
        resumed.
        * infcmd.c (signal_command): Add support for async mode.
        (finish_command): Only add continuation if the target was
        successfully resumed.
        * remote.c (init_async_opts): Register to_get_thread_local_address
        handler.
        * mi/mi-interp.c (mi_cmd_interpreter_exec): Don't mess
        with sync_execution.
        * tui/tui-interp.c (tui_command_loop): Call async_enable_stdin
        on exception.
2008-03-14 18:57:44 +00:00
Vladimir Prus 683f2885af 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.
2008-03-14 17:21:08 +00:00
Daniel Jacobowitz 9b254dd1ce Updated copyright notices for most files. 2008-01-01 22:53:26 +00:00
Ulrich Weigand 9612b5ec13 2007-10-02 Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
* tui/tui-interp.c (tui_init): Initialize tui's SIGWINCH
	signal handler.
	* tui/tui-win.c (tui_initialize_win): New function for
	initializing tui's SIGWINCH signal handler.
	* tui/tui-win.h (tui_initialize_win): Declare.
2007-10-02 16:50:08 +00:00
Joel Brobecker a9762ec78a Switch the license of all .c files to GPLv3.
Switch the license of all .h files to GPLv3.
        Switch the license of all .cc files to GPLv3.
2007-08-23 18:08:50 +00:00
Michael Snyder 1cc6d956c1 2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
	tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
	tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
	tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
	tui.c, tui.h: Comment reformatting to coding standard (capitals,
	spaces after periods, etc).
2007-08-14 21:20:09 +00:00
Michael Snyder 2ed23f5f14 2007-07-05 Michael Snyder <msnyder@access-company.com>
* event-top.c (cli_command_loop): Prompt string can (and should)
	be freed after call to readline (Coverity).  Also move local var
	declarations into block where they are used.

	* tui/tui-interp.c (tui_command_loop): Prompt string can (and
	should) be freed after call to readline (Coverity).  Also move
	local var declarations into block where they are used.
2007-07-05 22:47:27 +00:00
Daniel Jacobowitz 6aba47ca06 Copyright updates for 2007. 2007-01-09 17:59:20 +00:00
Eli Zaretskii 88d83552b1 * tui/tui-file.c:
* tui/tui-disasm.c:
	* tui/tui-data.h:
	* tui/tui-data.c:
	* tui/tui-command.h:
	* tui/tui-command.c:
	* tui/tui-win.h:
	* tui/tui-win.h:
	* tui/tui-win.c:
	* tui/tui-stack.h:
	* tui/tui-stack.c:
	* tui/tui-source.h:
	* tui/tui-source.c:
	* tui/tui-regs.h:
	* tui/tui-regs.c:
	* tui/tui-out.c:
	* tui/tui-main.c:
	* tui/tui-layout.h:
	* tui/tui-layout.c:
	* tui/tui-io.h:
	* tui/tui-io.c:
	* tui/tui-interp.c:
	* tui/tui-hooks.h:
	* tui/tui-hooks.c:
	* tui/tui-file.h:
	* tui/tui.h:
	* tui/tui.c:
	* tui/tui-winsource.h:
	* tui/tui-winsource.c:
	* tui/tui-wingeneral.h:
	* tui/tui-wingeneral.c:
	* tui/tui-windata.h:
	* tui/tui-windata.c: Add (C) after Copyright.  Update the FSF
	address.
2005-12-23 19:10:03 +00:00
Andrew Stubbs cc4349edfd 2005-11-07 Andrew Stubbs <andrew.stubbs@st.com>
* main.c (main): Use INTERP_TUI instead of "tui".
	Set interpreter to INTERP_INSIGHT when '-w' given.
	* interps.h (INTERP_INSIGHT): New define.
	* tui/tui-interp.c (_initialize_tui_interp): Use INTERP_TUI instead
	of "tui".
2005-11-07 12:46:38 +00:00
Andrew Cagney 71fff37b08 2005-04-26 Andrew Cagney <cagney@gnu.org>
Rename 'struct exception' to 'struct gdb_exception'.
	* wrapper.c: Update.
	* varobj.c: Update.
	* tui/tui-interp.c: Update.
	* remote.c: Update.
	* mi/mi-main.c: Update.
	* mi/mi-interp.c: Update.
	* linux-thread-db.c: Update.
	* interps.h: Update.
	* interps.c: Update.
	* exceptions.h: Update.
	* exceptions.c: Update.
	* dwarf2loc.c: Update.
	* cli/cli-interp.c: Update.
	* cli/cli-script.c: Update.
	* breakpoint.c: Update.
2005-04-26 05:03:41 +00:00
Andrew Cagney e2e0b3e57f 2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
	internal_error.
	* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
	* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
	* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
	* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
	* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
	* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
	* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
	* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
	* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
	* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
	* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
	* interps.c, language.c, linespec.c, linux-nat.c: Update.
	* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
	* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
	* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
	* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
	* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
	* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
	* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
	* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
	* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
	* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
	* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
	* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
	* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
	* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
	* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
	* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
	* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
	* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
	* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
	* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
	* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
	* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-11 18:13:55 +00:00
Andrew Cagney c1043fc2c1 2005-01-12 Andrew Cagney <cagney@gnu.org>
* exceptions.c (exception_none): New variable.
	* Makefile.in: Update dependencies.
	* interps.c: Include "exceptions.h".
	(interpreter_exec_cmd, interp_exec): Update to return "struct
	exception"
	* exceptions.h (no_exception): Declare.
	* tui/tui-interp.c (tui_exec): Update to return "struct exception"
	* mi/mi-interp.c: Include "exceptions.h".
	(mi_cmd_interpreter_exec, mi_interpreter_exec): Update to return
	'struct exception".
	* cli/cli-interp.c (cli_interpreter_exec, safe_execute_command)
	(do_captured_execute_command): Update to use catch_exception.
	* interps.h: Include "exceptions.h".
	(interp_exec_ftype, interp_exec): Return "struct exception".
2005-01-13 02:35:39 +00:00
Andrew Cagney 60250e8b18 2005-01-12 Andrew Cagney <cagney@gnu.org>
* exceptions.h (enum return_reason, RETURN_MASK)
	(RETURN_MASK_QUIT, RETURN_MASK_ERROR, RETURN_MASK_ALL)
	(return_mask, throw_exception, catch_exceptions_ftype)
	(catch_exceptions_with_msg, catch_errors_ftype, catch_errors)
	(catch_command_errors_ftype, catch_command_errors): Move to
	exceptions.h.
	* exceptions.c, exceptions.h: New files.
	* top.c: Do not include <setjmp.h>.
	(SIGJMP_BUF, SIGSETJMP, SIGLONGJMP, catch_return)
	(throw_exception, catcher, catch_exceptions)
	(catch_exceptions_with_msg, struct catch_errors_args)
	(do_catch_errors, catch_errors, struct captured_command_args)
	(do_captured_command, catch_command_errors): Move to exceptions.c.
	* wrapper.c, wince.c, win32-nat.c, utils.c: Include "exceptions.h".
	* tui/tui-interp.c, top.c, thread.c, symmisc.c: Ditto.
	* symfile-mem.c, stack.c, solib.c, rs6000-nat.c: Ditto.
	* remote-sds.c, remote-mips.c, remote-fileio.c: Ditto.
	* remote-e7000.c, objc-lang.c, ocd.c: Ditto.
	* remote.c, nto-procfs.c, monitor.c, mi/mi-main.c: Ditto.
	* main.c, m32r-rom.c, infrun.c, inf-loop.c: Ditto.
	* hppa-hpux-tdep.c, frame.c, event-top.c, event-loop.c: Ditto.
	* corelow.c, corefile.c, cli/cli-interp.c, breakpoint.c: Ditto.
	* ada-valprint.c, ada-lang.c: Ditto.
	* Makefile.in (HFILES_NO_SRCDIR, COMMON_OBS): Add exceptions.h and
	exceptions.o.  Update all dependencies.
2005-01-12 18:31:35 +00:00
Andrew Cagney dd1abb8c9e 2004-02-06 Andrew Cagney <cagney@redhat.com>
* tui/tui-data.h (struct tui_list): Rename _TuiList.
	(enum tui_data_type): Rename _TuiDataType.
	(struct tui_layout_def): Rename _TuiLayoutDef.
	(struct tui_source_element): Rename _TuiSourceElement.
	(struct tui_data_element): Rename _TuiDataElement.
	(struct tui_command_element): Rename _TuiCommandElement.
	(struct tui_locator_element): Rename _TuiLocatorElement.
	(union tui_which_element): Define.
	(struct tui_win_element): Rename _TuiWinElement.
	(struct tui_data_info): Rename _TuiDataInfo.
	(struct tui_source_info): Rename _TuiSourceInfo.
	(struct tui_command_info): Rename _TuiCommandInfo.
	(tui_initialize_static_data): Rename initializeStaticData.
	(tui_alloc_generic_win_info): Rename allocGenericWinInfo.
	(tui_alloc_win_info): Rename allocWinInfo.
	(tui_init_generic_part): Rename initGenericPart.
	(tui_init_win_info): Rename initWinInfo.
	(tui_alloc_content): Rename allocContent.
	(tui_add_content_elements): Rename addContentElements.
	(tui_init_content_element): Rename initContentElement.
	(tui_free_window): Rename freeWindow.
	(tui_free_win_content): Rename freeWinContent.
	(tui_free_data_content): Rename freeDataContent.
	(tui_free_all_source_wins_content): Rename
	freeAllSourceWinsContent.
	(tui_del_window): Rename tuiDelWindow.
	(tui_del_data_windows): Rename tuiDelDataWindows.
	(tui_partial_win_by_name): Rename partialWinByName.
	(tui_win_name): Rename winName.
	(tui_current_layout): Rename currentLayout.
	(tui_set_current_layout_to): Rename setCurrentLayoutTo.
	(tui_term_height): Rename termHeight.
	(tui_set_term_height_to): Rename setTermHeightTo.
	(tui_term_width): Rename termWidth.
	(tui_set_term_width_to): Rename setTermWidthTo.
	(tui_set_gen_win_origin): Rename setGenWinOrigin.
	(tui_locator_win_info_ptr): Rename locatorWinInfoPtr.
	(tui_source_exec_info_win_ptr): Rename tui_gen_win_info.
	(tui_disassem_exec_info_win_ptr): Rename disassemExecInfoWinPtr.
	(tui_source_windows): Rename sourceWindows.
	(tui_clear_source_windows): Rename clearSourceWindows.
	(tui_clear_source_windows_detail): Rename
	clearSourceWindowsDetail.
	(tui_clear_win_detail): Rename clearWinDetail.
	(tui_add_to_source_windows): Rename tuiAddToSourceWindows.
	(tui_default_tab_len): Rename tuiDefaultTabLen.
	(tui_set_default_tab_len): Rename tuiSetDefaultTabLen.
	(tui_win_with_focus): Rename tuiWinWithFocus.
	(tui_set_win_with_focus): Rename tuiSetWinWithFocus.
	(tui_layout_def): Rename tuiLayoutDef.
	(tui_win_resized): Rename tuiWinResized.
	(tui_set_win_resized_to): Rename tuiSetWinResizedTo.
	(tui_next_win): Rename tuiNextWin.
	(tui_prev_win): Rename tuiPrevWin.
	(tui_add_to_source_windows): Rename addToSourceWindows.
	* tui/tui-winsource.c, tui/tui-win.c: Update references.
	* tui/tui-layout.c, tui/tui-source.c: Ditto.
	* tui/tui-stack.c, tui/tui-io.c: Ditto.
	* tui/tui.c, tui/tui-data.c: Ditto.
	* tui/tui-interp.c, tui/tui-data.c: Ditto.
	* tui/tui-disasm.c, tui/tui-command.c: Ditto.
2004-02-07 04:40:36 +00:00
Andrew Cagney d7b2e96719 2004-01-18 Andrew Cagney <cagney@redhat.com>
* tui/tui-command.c: Rename tui/tuiCommand.c.
	* tui/tui-command.h: Rename tui/tuiCommand.h.
	* tui/tui-data.c: Rename tui/tuiData.c.
	* tui/tui-data.h: Rename tui/tuiData.h.
	* tui/tui-disasm.c: Rename tui/tuiDisassem.c.
	* tui/tui-disasm.h: Rename tui/tuiDisassem.h.
	* tui/tui-io.c: Rename tui/tuiIO.c.
	* tui/tui-io.h: Rename tui/tuiIO.h.
	* tui/tui-layout.c: Rename tui/tuiLayout.c.
	* tui/tui-layout.h: Rename tui/tuiLayout.h.
	* tui/tui-regs.c: Rename tui/tuiRegs.c.
	* tui/tui-regs.h: Rename tui/tuiRegs.h.
	* tui/tui-source.c: Rename tui/tuiSource.c.
	* tui/tui-source.h: Rename tui/tuiSource.h.
	* tui/tui-stack.c: Rename tui/tuiStack.c.
	* tui/tui-stack.h: Rename tui/tuiStack.h.
	* tui/tui-win.c: Rename tui/tuiWin.c.
	* tui/tui-win.h: Rename tui/tuiWin.h.
	* tui/tui-windata.c: Rename tui/tuiDataWin.c.
	* tui/tui-windata.h: Rename tui/tuiDataWin.h.
	* tui/tui-wingeneral.c: Rename tui/tuiGeneralWin.c.
	* tui/tui-wingeneral.h: Rename tui/tuiGeneralWin.h.
	* tui/tui-winsource.c: Rename tui/tuiSourceWin.c.
	* tui/tui-winsource.h: Rename tui/tuiSourceWin.h.
	* tui/tui-file.c: Update includes.
	* tui/tui-hooks.c: Update includes.
	* tui/tui-interp.c: Update includes.
	* tui/tui.c: Update includes.
	* Makefile.in: Update all tui/ dependencies.
	(SUBDIR_TUI_OBS, SUBDIR_TUI_SRCS): Update file names.
2004-01-19 04:31:53 +00:00
Daniel Jacobowitz 95cd630eae * tui-interp.c: Include "cli-out.h".
(tui_resume): Update tui_old_uiout's stream to gdb_stdout.
2003-08-04 19:28:17 +00:00
Stephane Carrez 6385821035 * tui-interp.c (tui_resume): Enable tui when we expected it.
(tui_suspend): Remember in which TUI mode we are.
	(_initialize_tui_interp): Use the tui interpreter even when no
	other interpreter was set and define in which TUI mode to start.
2003-07-23 21:22:14 +00:00
Andrew Cagney 021e760905 2003-02-14 Andrew Cagney <ac131313@redhat.com>
* main.c (tui_version): Delete variable.
	(captured_main): When --tui, set interpreter_p to "tui" instead of
	enabling tui_version.
	* printcmd.c (display_command) [TUI]: Test tui_active instead of
	tui_version.
	* cli/cli-decode.c (lookup_cmd_composition): Ditto.
	* cli/cli-cmds.c (disassemble_command): Ditto.
	* defs.h (tui_version): Delete declaration.
	* Makefile.in (SUBDIR_TUI_SRCS): Add "tui/tui-interp.c".
	(tui-interp.o): Add rules.
	(SUBDIR_TUI_OBS): Add "tui-interp.o".

Index: tui/ChangeLog
2003-02-14  Andrew Cagney  <ac131313@redhat.com>

	* tui.c (tui_enable, tui_disable): Don't modify tui_version.
	(tui_is_window_visible, tui_get_command_dimension): Test
	tui_active instead of tui_version.
	* tuiData.h (tui_version): Delete declaration.
	* tui-hooks.c (tui_init_hook, tui_event_loop): Delete function,
	moved to "tui-interp.c".
	(tui_exit, tui_command_loop): Ditto.
	(_initialize_tui): Don't initialize init_ui_hook.  Initialize
	target_new_objfile_hook.
	* tui-interp.c: New file.
2003-02-14 13:58:06 +00:00