Commit Graph

22 Commits

Author SHA1 Message Date
Daniel Jacobowitz bee0189a82 From Kaveh R. Ghazi <ghazi@caip.rutgers.edu>:
gdb/
	* cli-out.c (cli_field_fmt, cli_message, out_field_fmt): Add
	ATTR_FORMAT or ATTRIBUTE_FPTR_PRINTF.
	* complaints.c (vcomplaint): Likewise.
	* defs.h (xvasprintf, xstrvprintf, verror, vfatal)
	(internal_verror, internal_vwarning, vwarning)
	(deprecated_query_hook, deprecated_warning_hook)
	(deprecated_readline_begin_hook): Likewise.
	* disasm.c (fprintf_disasm): Likewise.
	* exceptions.c (throw_it): Likewise.
	* exceptions.h (throw_verror, throw_vfatal): Likewise.
	* mi/mi-interp.c (mi_interp_query_hook): Likewise.
	* mi/mi-out.c (mi_field_fmt, mi_message): Likewise.
	* tui/tui-hooks.c (tui_query_hook): Likewise.
	* tui/tui-out.c (tui_field_fmt, tui_message, out_field_fmt):
	Likewise.
	* ui-out.c (default_field_fmt, default_message, uo_field_fmt)
	(uo_message): Likewise.
	* ui-out.h (ui_out_field_fmt, ui_out_message, field_fmt_ftype)
	(message_ftype): Likewise.
	* utils.c (vfprintf_maybe_filtered, internal_vproblem)
	(defaulted_query, printchar): Likewise.
gdb/gdbserver/
	* server.h (error, fatal, warning): Add ATTR_FORMAT.
2005-07-31 20:56:26 +00:00
Paul Brook cade9e545b 2005-04-28 Paul Brook <paul@codesourcery.com>
* exceptions.c (print_flush): Handle NULL gdb_stdout_serial.
2005-04-28 14:07:54 +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 6941d02a18 2005-02-08 Andrew Cagney <cagney@gnu.org>
* exceptions.c: Do not include <setjmp.h>.
	(SIGJMP_BUF, SIGSETJMP, SIGLONGJMP): Delete macros.
	(catch_exception, catch_exceptions_with_msg, catch_errors)
	(catch_command_errors): Use TRY_CATCH.
	(struct catcher): Use EXCEPTIONS_SIGJMP_BUF.
	(exceptions_state_mc_init): Rename catcher_init.
	(exceptions_state_mc): Rename catcher_state_machine.
	(exceptions_state_mc_action_iter)
	(exceptions_state_mc_action_iter_1): New functions.
	* exceptions.h: Include <setjmp.h>.
	(EXCEPTIONS_SIGJMP_BUF, EXCEPTIONS_SIGSETJMP)
	(EXCEPTIONS_SIGLONGJMP): Define.
	(exceptions_state_mc_init, exceptions_state_mc_action_iter)
	(exceptions_state_mc_action_iter_1): Declare.
	(TRY_CATCH): Define.
2005-02-08 23:44:06 +00:00
Andrew Cagney e06e235377 2005-01-19 Andrew Cagney <cagney@gnu.org>
* utils.c (quit): Simplify, call fatal.
	* exceptions.c: Include "serial.h"
	(print_flush): Mimic flush code found in utils.c:quit.
	* Makefile.in: Update dependencies.
2005-01-19 22:54:56 +00:00
Andrew Cagney 315a522ef2 2005-01-19 Andrew Cagney <cagney@gnu.org>
* exceptions.h (deprecated_throw_reason): Rename throw_reason.
	* exceptions.c (deprecated_throw_reason): Rename throw_reason.
	* utils.c (internal_verror, quit): Update.
	* remote-sds.c (interrupt_query): Update.
	* remote-mips.c (mips_error, mips_kill): Update.
	* remote-fileio.c (remote_fileio_ctrl_c_signal_handler): Update.
	* remote.c (interrupt_query): Update.
	* ocd.c (interrupt_query): Update.
	* nto-procfs.c (interrupt_query): Update.
	* monitor.c (monitor_interrupt_query): Update.
	* breakpoint.c (break_command_1): Update.
2005-01-19 21:15:44 +00:00
Andrew Cagney 17d92a0219 2005-01-16 Andrew Cagney <cagney@gnu.org>
* cli/cli-script.c: Include "exceptions.h".
	(struct wrapped_read_command_file_args): Define.
	(wrapped_read_command_file): New function.
	(script_from_file): Replace direct call to read_command_file by
	one wrapped by an exception handler.
	* exceptions.c (throw_it): Free the old message after creating the
	new.
	* Makefile.in: Update dependencies.

Index: testsuite/ChangeLog
2005-01-16  Andrew Cagney  <cagney@gnu.org>

	* gdb.base/source.exp: Delete KFAIL gdb/1846, simplify.
2005-01-16 21:20:06 +00:00
Andrew Cagney 6212a5e9ad 2005-01-16 Andrew Cagney <cagney@gnu.org>
* exceptions.c (struct catcher): Delete saved_error_pre_print and
	saved_quit_pre_print.
	(catcher_init): Delete parameter errstring, do not override the
	pre_print strings.
	(catcher_pop): Do not restore the pre_print strings.
	(catch_exception, catch_exceptions_with_msg, catch_errors)
	(catch_command_errors): Update catch_init calls.
2005-01-16 19:51:51 +00:00
Andrew Cagney 5a14cc1abc 2005-01-15 Andrew Cagney <cagney@gnu.org>
* exceptions.c (do_captured_command)
	(struct captured_command_args): Delete.
	(catch_command_errors): Simplify by inlining call to catch_errors.
2005-01-15 18:59:43 +00:00
Andrew Cagney 3af1e0e300 2005-01-15 Andrew Cagney <cagney@gnu.org>
* exceptions.c (struct catcher): Delete field print_message.
	(catcher_init): Delete print_message parameter.
	(catch_exception, catch_exceptions_with_msg, catch_errors): Update.
	(throw_it): Delete prefix parameter.
	(throw_verror, throw_vfatal, throw_error): Update.
2005-01-15 06:03:34 +00:00
Andrew Cagney e48f5bee49 2005-01-14 Andrew Cagney <cagney@gnu.org>
* exceptions.c (print_and_throw): Delete, replaced by throw_it.
	(throw_reason): Leave the exception's message field blank.
	(throw_it): New function, create the exception and throw it.
	(throw_verror, throw_vfatal, throw_error): Call throw_it.
	(print_any_exception): New function.
	(catch_errors, catch_exceptions_with_msg): Call
	print_any_exception.
	(throw_exception): Move code calling annotate_error and
	annotate_quit from here ...
	(print_exception): ... to here.
2005-01-15 05:16:15 +00:00
Andrew Cagney c6da7a6d7d 2005-01-14 Andrew Cagney <cagney@gnu.org>
* exceptions.c (exception_fprintf, exception_print): Move printing
	of \n from here ...
	(print_exception): ... to here.
	(print_flush): New function.
	(exception_print, exception_fprintf): Replace duplicated flush and
	wrap code with call to print_flush.
	(print_and_throw): Simplify, by using xstrvprintf, print_flush,
	and print_exception.
	(do_write): Delete.
2005-01-15 04:31:10 +00:00
Andrew Cagney 1c3c7ee7fb 2005-01-14 Andrew Cagney <cagney@gnu.org>
* exceptions.h (catch_exceptions): Delete errstring parameter.
	(catch_exceptions_with_msg): Ditto.
	* exceptions.c (catch_exceptions_with_msg): Update.
	(catch_exceptions): Update.
	* symfile-mem.c (add_vsyscall_page): Update.
	* frame.c (get_current_frame): Update.
	* wrapper.c (gdb_value_struct_elt): Update.
	* exceptions.c (catch_exceptions): Update.
	* thread.c (gdb_list_thread_ids, gdb_thread_select): Update.
	* breakpoint.c (gdb_breakpoint_query, gdb_breakpoint): Update.
	* remote-fileio.c (remote_fileio_request): Update.
2005-01-14 23:27:14 +00:00
Andrew Cagney 9cbc821d4e 2005-01-14 Andrew Cagney <cagney@gnu.org>
* exceptions.h (exception_fprintf): Declare.
	(exception_print): Drop pre_print parameter.
	* mi/mi-main.c (mi_execute_command): Update exception_print call.
	* cli/cli-interp.c (safe_execute_command): Update exception_print
	call.
	* remote.c (remote_open_1): Instead of passing an error prefix to
	catch_exceptions, use catch_exceptions and exception_fprintf.
	(remote_start_remote): Change return type to void.
	* breakpoint.c (insert_bp_location): Instead of passing an error
	prefix to catch_exceptions, use catch_exceptions and
	exception_fprintf.
	(insert_catchpoint): Change return type to void.
	(break_command_1): Update exception_print call.
	* exceptions.c (exception_fprintf): New function.
	(print_exception): New function.
	(exception_print): Use print_exception.
2005-01-14 22:59:36 +00:00
Andrew Cagney 05ff989b0b 2005-01-14 Andrew Cagney <cagney@gnu.org>
* linespec.c (symtab_from_filename, decode_variable): Use
	throw_error instead of error_silent.
	* breakpoint.c (do_captured_parse_breakpoint): Change return type
	to void.
	(break_command_1): Use catch_exception and check the error return
	status.
	* exceptions.c (throw_error): New function.
	(throw_vsilent): Delete function.
	* exceptions.h (throw_error): Declare.
	(throw_vsilent): Delete declaration.
	* utils.c (error_silent): Delete function.
	* defs.h (error_silent): Delete declaration.
2005-01-14 20:24:20 +00:00
Andrew Cagney 8a076db965 2005-01-13 Andrew Cagney <cagney@gnu.org>
* mi/mi-main.c (mi_execute_command): Print the exception.
	* cli/cli-interp.c (safe_execute_command): Print the exception.
	* exceptions.h (exception_print): Declare.
	* exceptions.c (struct catcher): Add field print_message.
	(catcher_init): Add parameter print_message, store in the catcher
	struct.
	(print_and_throw): Only print the message when print_message.
	(catch_exceptions_with_msg, catch_errors): Pass print_message=1 to
	catcher_init.
	(catch_exception): Pass print_message=0 to catcher_init.
2005-01-14 18:55:33 +00:00
Andrew Cagney 6b1b7650d1 2005-01-13 Andrew Cagney <cagney@gnu.org>
* defs.h (error_last_message, error_init): Delete declaration.
	* utils.c (fatal, vfatal): Call throw_vfatal.
	(error, verror): Call throw_verror;
	(do_write, error_stream_1): Delete function.
	(error_stream): Simplify, call error.
	(error_last_message, error_init, gdb_lasterr): Delete.
	(error_silent): Simplify, call throw_vsilent.
	* mi/mi-interp.c (mi_cmd_interpreter_exec): Dup the message.
	* main.c (captured_main): Delete call to error_init.
	* exceptions.c (throw_verror, throw_verror)
	(throw_vsilent): New functions.
	(do_write, print_and_throw): New functions.
	(last_message): New global.
	(throw_reason): Replace error_last_message with last_message.
	(catch_exceptions_with_msg): Dup the message.
	* exceptions.h (throw_verror, throw_vfatal, throw_vsilent):
	Declare.
2005-01-14 01:20:38 +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 2a78bfb53c 2005-01-12 Andrew Cagney <cagney@gnu.org>
* exceptions.h (throw_reason): Rename throw_exception.
	(enum errors, struct exception): Define.
	(catch_exception_ftype): Define.
	(catch_exception, throw_exception): Declare.
	* exceptions.c (throw_exception): Rewrite.
	(throw_reason): New function.
	(struct catcher, catcher_state_machine): Replace "reason" with
	"exception", delete "gdberrmsg".
	(catch_exception): New function.
	(catcher_init): Replace "gdberrmsg" parameter with "exception".
	(catch_errors, catch_exceptions_with_msg): Re-implement passing
	exception to catcher_init.
	* utils.c (error_silent, error_stream_1): Use throw_reason.
	(internal_verror, quit): Ditto.
	* breakpoint.c (insert_catchpoint, break_command_1): Ditto.
	* remote-fileio.c (remote_fileio_ctrl_c_signal_handler): Ditto.
	* remote.c (remote_open_1, interrupt_query): Ditto.
2005-01-13 00:12:50 +00:00
Andrew Cagney db5f402d40 2005-01-12 Andrew Cagney <cagney@gnu.org>
* exceptions.c: Include "gdb_string.h".
	(enum catcher_state, struct catcher): Define.
	(current_catcher): New global, replaces catch_return;
	(catch_return): Delete.
	(throw_exception): Use current_catcher->buf;
	(catcher_init, catcher_pop, catcher_state_machine): New functions.
	(catcher): Delete.
	(struct catch_errors_args): Delete.
	(do_catch_errors): Delete.
	(catch_exceptions): Replace body with call to
	catch_exceptions_with_msg.
	(catcher): Delete.
	(catch_exceptions_with_msg, catch_errors): Re-implement using
	catcher_state_machine.
2005-01-12 19:12:29 +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