This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Move gdb's throw/catch mechanism to exceptions.[hc]


The throw_exception / catch_errors code was scattered across defs.h / top.c. This moves it all to exceptions.[hc]. The change is mind-nummingly mechanical.

More code (e.g., error()) can probably be migrated over time.

committed,
Andrew
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.
	
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.685
diff -p -u -r1.685 Makefile.in
--- Makefile.in	10 Jan 2005 20:56:16 -0000	1.685
+++ Makefile.in	12 Jan 2005 18:26:42 -0000
@@ -667,6 +667,7 @@ dwarf2loc_h = dwarf2loc.h
 environ_h = environ.h
 event_loop_h = event-loop.h
 event_top_h = event-top.h
+exceptions_h = exceptions.h
 exec_h = exec.h $(target_h)
 expression_h = expression.h $(symtab_h) $(doublest_h)
 fbsd_nat_h = fbsd-nat.h
@@ -732,15 +733,15 @@ memattr_h = memattr.h
 mips_mdebug_tdep_h = mips-mdebug-tdep.h
 mipsnbsd_tdep_h = mipsnbsd-tdep.h
 mips_tdep_h = mips-tdep.h
+mn10300_tdep_h = mn10300-tdep.h
 monitor_h = monitor.h
 nbsd_tdep_h = nbsd-tdep.h
-ns32k_tdep_h = ns32k-tdep.h
-nto_tdep_h = nto-tdep.h $(defs_h) $(solist_h)
+nto_tdep_h = nto-tdep.h $(defs_h) $(solist_h) $(osabi_h) $(regset_h)
 objc_lang_h = objc-lang.h
 objfiles_h = objfiles.h $(gdb_obstack_h) $(symfile_h)
 ocd_h = ocd.h
 osabi_h = osabi.h
-solib_pa64_h = solib-pa64.h
+pa64solib_h = pa64solib.h
 parser_defs_h = parser-defs.h $(doublest_h)
 p_lang_h = p-lang.h
 ppcnbsd_tdep_h = ppcnbsd-tdep.h
@@ -763,9 +764,11 @@ shnbsd_tdep_h = shnbsd-tdep.h
 sh_tdep_h = sh-tdep.h
 sim_regno_h = sim-regno.h
 solib_h = solib.h
+solib_pa64_h = solib-pa64.h
+solib_som_h = solib-som.h
 solib_svr4_h = solib-svr4.h
 solist_h = solist.h
-solib_som_h = solib-som.h
+somsolib_h = somsolib.h
 source_h = source.h
 sparc64_tdep_h = sparc64-tdep.h $(sparc_tdep_h)
 sparc_nat_h = sparc-nat.h
@@ -844,6 +847,7 @@ tui_winsource_h = $(srcdir)/tui/tui-wins
 # right, it is probably easiest just to list .h files here directly.
 
 HFILES_NO_SRCDIR = bcache.h buildsym.h call-cmds.h coff-solib.h defs.h \
+	exceptions.h \
 	environ.h $(gdbcmd_h) gdb.h gdbcore.h \
 	gdb-stabs.h $(inferior_h) language.h minimon.h monitor.h \
 	objfiles.h parser-defs.h serial.h solib.h \
@@ -895,6 +899,7 @@ COMMON_OBS = $(DEPFILES) $(YYOBJ) \
 	infcall.o \
 	infcmd.o infrun.o \
 	expprint.o environ.o stack.o thread.o \
+	exceptions.o \
 	inf-child.o \
 	interps.o \
 	main.o \
@@ -1627,14 +1632,15 @@ ada-lang.o: ada-lang.c $(defs_h) $(gdb_s
 	$(inferior_h) $(symfile_h) $(objfiles_h) $(breakpoint_h) \
 	$(gdbcore_h) $(hashtab_h) $(gdb_obstack_h) $(ada_lang_h) \
 	$(completer_h) $(gdb_stat_h) $(ui_out_h) $(block_h) $(infcall_h) \
-	$(dictionary_h)
+	$(dictionary_h) $(exceptions_h)
 ada-typeprint.o: ada-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) \
 	$(symtab_h) $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) \
 	$(target_h) $(command_h) $(gdbcmd_h) $(language_h) $(demangle_h) \
 	$(c_lang_h) $(typeprint_h) $(ada_lang_h) $(gdb_string_h)
 ada-valprint.o: ada-valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) \
 	$(gdbtypes_h) $(expression_h) $(value_h) $(demangle_h) $(valprint_h) \
-	$(language_h) $(annotate_h) $(ada_lang_h) $(c_lang_h) $(infcall_h)
+	$(language_h) $(annotate_h) $(ada_lang_h) $(c_lang_h) $(infcall_h) \
+	$(exceptions_h)
 aix-thread.o: aix-thread.c $(defs_h) $(gdb_assert_h) $(gdbthread_h) \
 	$(target_h) $(inferior_h) $(regcache_h) $(gdbcmd_h) $(ppc_tdep_h) \
 	$(gdb_string_h)
@@ -1750,7 +1756,7 @@ breakpoint.o: breakpoint.c $(defs_h) $(s
 	$(gdb_string_h) $(demangle_h) $(annotate_h) $(symfile_h) \
 	$(objfiles_h) $(source_h) $(linespec_h) $(completer_h) $(gdb_h) \
 	$(ui_out_h) $(cli_script_h) $(gdb_assert_h) $(block_h) $(solist_h) \
-	$(observer_h) $(gdb_events_h)
+	$(observer_h) $(exceptions_h) $(gdb_events_h)
 bsd-kvm.o: bsd-kvm.c $(defs_h) $(cli_cmds_h) $(command_h) $(frame_h) \
 	$(regcache_h) $(target_h) $(value_h) $(gdbcore_h) $(gdb_assert_h) \
 	$(readline_h) $(bsd_kvm_h)
@@ -1789,11 +1795,12 @@ core-aout.o: core-aout.c $(defs_h) $(gdb
 	$(gdb_dirent_h) $(gdb_stat_h)
 corefile.o: corefile.c $(defs_h) $(gdb_string_h) $(inferior_h) $(symtab_h) \
 	$(command_h) $(gdbcmd_h) $(bfd_h) $(target_h) $(gdbcore_h) \
-	$(dis_asm_h) $(gdb_stat_h) $(completer_h)
+	$(dis_asm_h) $(gdb_stat_h) $(completer_h) $(exceptions_h)
 corelow.o: corelow.c $(defs_h) $(arch_utils_h) $(gdb_string_h) $(frame_h) \
 	$(inferior_h) $(symtab_h) $(command_h) $(bfd_h) $(target_h) \
 	$(gdbcore_h) $(gdbthread_h) $(regcache_h) $(regset_h) $(symfile_h) \
-	$(exec_h) $(readline_h) $(observer_h) $(gdb_assert_h)
+	$(exec_h) $(readline_h) $(observer_h) $(gdb_assert_h) \
+	$(exceptions_h)
 core-regset.o: core-regset.c $(defs_h) $(command_h) $(gdbcore_h) \
 	$(inferior_h) $(target_h) $(gdb_string_h) $(gregset_h)
 cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(command_h) $(gdbcmd_h) \
@@ -1880,10 +1887,11 @@ eval.o: eval.c $(defs_h) $(gdb_string_h)
 	$(f_lang_h) $(cp_abi_h) $(infcall_h) $(objc_lang_h) $(block_h) \
 	$(parser_defs_h)
 event-loop.o: event-loop.c $(defs_h) $(event_loop_h) $(event_top_h) \
-	$(gdb_string_h)
+	$(gdb_string_h) $(exceptions_h)
 event-top.o: event-top.c $(defs_h) $(top_h) $(inferior_h) $(target_h) \
 	$(terminal_h) $(event_loop_h) $(event_top_h) $(interps_h) \
-	$(gdbcmd_h) $(readline_h) $(readline_history_h)
+	$(exceptions_h) $(gdbcmd_h) $(readline_h) $(readline_history_h)
+exceptions.o: exceptions.c
 exec.o: exec.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcmd_h) \
 	$(language_h) $(symfile_h) $(objfiles_h) $(completer_h) $(value_h) \
 	$(exec_h) $(readline_h) $(gdb_string_h) $(gdbcore_h) $(gdb_stat_h) \
@@ -1913,7 +1921,7 @@ frame.o: frame.c $(defs_h) $(frame_h) $(
 	$(regcache_h) $(gdb_assert_h) $(gdb_string_h) $(user_regs_h) \
 	$(gdb_obstack_h) $(dummy_frame_h) $(sentinel_frame_h) $(gdbcore_h) \
 	$(annotate_h) $(language_h) $(frame_unwind_h) $(frame_base_h) \
-	$(command_h) $(gdbcmd_h) $(observer_h) $(objfiles_h)
+	$(command_h) $(gdbcmd_h) $(observer_h) $(objfiles_h) $(exceptions_h)
 frame-unwind.o: frame-unwind.c $(defs_h) $(frame_h) $(frame_unwind_h) \
 	$(gdb_assert_h) $(dummy_frame_h) $(gdb_obstack_h)
 frv-linux-tdep.o: frv-linux-tdep.c $(defs_h) $(target_h) $(frame_h) \
@@ -1957,9 +1965,6 @@ go32-nat.o: go32-nat.c $(defs_h) $(infer
 	$(command_h) $(gdbcmd_h) $(floatformat_h) $(buildsym_h) \
 	$(i387_tdep_h) $(i386_tdep_h) $(value_h) $(regcache_h) \
 	$(gdb_string_h)
-h8300-tdep.o: h8300-tdep.c $(defs_h) $(value_h) $(inferior_h) $(symfile_h) \
-	$(arch_utils_h) $(regcache_h) $(gdbcore_h) $(objfiles_h) $(gdbcmd_h) \
-	$(gdb_assert_h) $(dis_asm_h)
 hpacc-abi.o: hpacc-abi.c $(defs_h) $(value_h) $(gdb_regex_h) $(gdb_string_h) \
 	$(gdbtypes_h) $(gdbcore_h) $(cp_abi_h)
 hppabsd-nat.o: hppabsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
@@ -1971,10 +1976,10 @@ hppa-hpux-nat.o: hppa-hpux-nat.c $(defs_
 	$(target_h) $(gdb_assert_h) $(hppa_tdep_h) $(inf_ptrace_h) \
 	$(inf_ttrace_h)
 hppa-hpux-tdep.o: hppa-hpux-tdep.c $(defs_h) $(arch_utils_h) $(gdbcore_h) \
-	$(osabi_h) $(gdb_string_h) $(frame_h) $(frame_unwind_h) \
-	$(trad_frame_h) $(tramp_frame_h) $(symtab_h) $(objfiles_h) \
-	$(inferior_h) $(infcall_h) $(observer_h) $(hppa_tdep_h) $(solib_som_h) \
-	$(solib_pa64_h) $(regset_h)
+	$(osabi_h) $(frame_h) $(frame_unwind_h) $(trad_frame_h) $(symtab_h) \
+	$(objfiles_h) $(inferior_h) $(infcall_h) $(observer_h) \
+	$(hppa_tdep_h) $(solib_som_h) $(solib_pa64_h) $(regset_h) \
+	$(exceptions_h) $(gdb_string_h)
 hppa-linux-nat.o: hppa-linux-nat.c $(defs_h) $(gdbcore_h) $(regcache_h) \
 	$(gdb_string_h) $(inferior_h) $(hppa_tdep_h) $(gregset_h)
 hppa-linux-tdep.o: hppa-linux-tdep.c $(defs_h) $(gdbcore_h) $(osabi_h) \
@@ -1989,9 +1994,10 @@ hppa-tdep.o: hppa-tdep.c $(defs_h) $(bfd
 hpread.o: hpread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(hp_symtab_h) \
 	$(syms_h) $(symtab_h) $(symfile_h) $(objfiles_h) $(buildsym_h) \
 	$(complaints_h) $(gdb_stabs_h) $(gdbtypes_h) $(demangle_h) \
-	$(solib_som_h) $(gdb_assert_h) $(hppa_tdep_h)
+	$(solib_som_h) $(gdb_assert_h) $(hppa_tdep_h) $(gdb_string_h)
 hpux-thread.o: hpux-thread.c $(defs_h) $(gdbthread_h) $(target_h) \
-	$(inferior_h) $(regcache_h) $(gdb_stat_h) $(gdbcore_h)
+	$(inferior_h) $(regcache_h) $(gdb_stat_h) $(gdbcore_h) \
+	$(hppa_tdep_h)
 i386bsd-nat.o: i386bsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
 	$(gdb_assert_h) $(i386_tdep_h) $(i387_tdep_h) $(i386bsd_nat_h) \
 	$(inf_ptrace_h)
@@ -2023,9 +2029,9 @@ i386nbsd-tdep.o: i386nbsd-tdep.c $(defs_
 	$(gdbcore_h) $(regcache_h) $(regset_h) $(osabi_h) $(symtab_h) \
 	$(gdb_assert_h) $(gdb_string_h) $(i386_tdep_h) $(i387_tdep_h) \
 	$(nbsd_tdep_h) $(solib_svr4_h)
-i386-nto-tdep.o: i386-nto-tdep.c $(gdb_string_h) $(gdb_assert_h) $(defs_h) \
-	$(frame_h) $(target_h) $(regcache_h) $(solib_svr4_h) $(i386_tdep_h) \
-	$(nto_tdep_h) $(osabi_h) $(i387_tdep_h)
+i386-nto-tdep.o: i386-nto-tdep.c $(defs_h) $(frame_h) $(osabi_h) \
+	$(regcache_h) $(target_h) $(gdb_assert_h) $(gdb_string_h) \
+	$(i386_tdep_h) $(i387_tdep_h) $(nto_tdep_h) $(solib_svr4_h)
 i386obsd-nat.o: i386obsd-nat.c $(defs_h) $(i386_tdep_h)
 i386obsd-tdep.o: i386obsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \
 	$(gdbcore_h) $(regcache_h) $(regset_h) $(symtab_h) $(objfiles_h) \
@@ -2059,8 +2065,8 @@ ia64-tdep.o: ia64-tdep.c $(defs_h) $(inf
 	$(arch_utils_h) $(floatformat_h) $(regcache_h) $(reggroups_h) \
 	$(frame_h) $(frame_base_h) $(frame_unwind_h) $(doublest_h) \
 	$(value_h) $(gdb_assert_h) $(objfiles_h) $(elf_common_h) \
-	$(elf_bfd_h) $(dis_asm_h) $(infcall_h) $(ia64_tdep_h) $(elf_ia64_h) \
-	$(libunwind_frame_h) $(libunwind_ia64_h) $(osabi_h)
+	$(elf_bfd_h) $(dis_asm_h) $(infcall_h) $(osabi_h) $(ia64_tdep_h) \
+	$(elf_ia64_h) $(libunwind_frame_h) $(libunwind_ia64_h)
 infcall.o: infcall.c $(defs_h) $(breakpoint_h) $(target_h) $(regcache_h) \
 	$(inferior_h) $(gdb_assert_h) $(block_h) $(gdbcore_h) $(language_h) \
 	$(objfiles_h) $(gdbcmd_h) $(command_h) $(gdb_string_h) $(infcall_h) \
@@ -2074,27 +2080,27 @@ infcmd.o: infcmd.c $(defs_h) $(gdb_strin
 	$(parser_defs_h) $(regcache_h) $(reggroups_h) $(block_h) \
 	$(gdb_assert_h)
 inf-loop.o: inf-loop.c $(defs_h) $(inferior_h) $(target_h) $(event_loop_h) \
-	$(event_top_h) $(inf_loop_h) $(remote_h)
+	$(event_top_h) $(inf_loop_h) $(remote_h) $(exceptions_h)
 inflow.o: inflow.c $(defs_h) $(frame_h) $(inferior_h) $(command_h) \
 	$(serial_h) $(terminal_h) $(target_h) $(gdbthread_h) $(gdb_string_h) \
 	$(inflow_h)
 inf-ptrace.o: inf-ptrace.c $(defs_h) $(command_h) $(inferior_h) $(inflow_h) \
 	$(gdbcore_h) $(observer_h) $(regcache_h) $(gdb_assert_h) \
 	$(gdb_string_h) $(gdb_ptrace_h) $(gdb_wait_h) $(inf_child_h)
-inf-ttrace.o: inf-ttrace.c $(defs_h) $(command_h) $(gdbcore_h) \
-	$(gdbthread_h) $(inferior_h) $(observer_h) $(target_h) \
-	$(gdb_assert_h) $(gdb_string_h) $(inf_child_h) $(inf_ttrace_h)
 infptrace.o: infptrace.c $(defs_h) $(command_h) $(frame_h) $(gdbcore_h) \
 	$(inferior_h) $(regcache_h) $(target_h) $(gdb_assert_h) \
 	$(gdb_wait_h) $(gdb_string_h) $(gdb_dirent_h) $(gdb_ptrace_h)
 infrun.o: infrun.c $(defs_h) $(gdb_string_h) $(symtab_h) $(frame_h) \
-	$(inferior_h) $(breakpoint_h) $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) \
-	$(cli_script_h) $(target_h) $(gdbthread_h) $(annotate_h) \
-	$(symfile_h) $(top_h) $(inf_loop_h) $(regcache_h) $(value_h) \
-	$(observer_h) $(language_h) $(gdb_assert_h)
+	$(inferior_h) $(exceptions_h) $(breakpoint_h) $(gdb_wait_h) \
+	$(gdbcore_h) $(gdbcmd_h) $(cli_script_h) $(target_h) $(gdbthread_h) \
+	$(annotate_h) $(symfile_h) $(top_h) $(inf_loop_h) $(regcache_h) \
+	$(value_h) $(observer_h) $(language_h) $(gdb_assert_h)
 inftarg.o: inftarg.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
 	$(gdbcore_h) $(command_h) $(gdb_stat_h) $(observer_h) $(gdb_wait_h) \
 	$(inflow_h)
+inf-ttrace.o: inf-ttrace.c $(defs_h) $(command_h) $(gdbcore_h) \
+	$(gdbthread_h) $(inferior_h) $(observer_h) $(target_h) \
+	$(gdb_assert_h) $(gdb_string_h) $(inf_child_h) $(inf_ttrace_h)
 interps.o: interps.c $(defs_h) $(gdbcmd_h) $(ui_out_h) $(event_loop_h) \
 	$(event_top_h) $(interps_h) $(completer_h) $(gdb_string_h) \
 	$(gdb_events_h) $(gdb_assert_h) $(top_h)
@@ -2131,6 +2137,10 @@ linux-nat.o: linux-nat.c $(defs_h) $(inf
 	$(gdb_wait_h) $(gdb_assert_h) $(linux_nat_h) $(gdbthread_h) \
 	$(gdbcmd_h) $(regcache_h) $(elf_bfd_h) $(gregset_h) $(gdbcore_h) \
 	$(gdbthread_h) $(gdb_stat_h)
+linux-thread-db.o: linux-thread-db.c $(defs_h) $(gdb_assert_h) \
+	$(gdb_proc_service_h) $(gdb_thread_db_h) $(bfd_h) $(gdbthread_h) \
+	$(inferior_h) $(symfile_h) $(objfiles_h) $(target_h) $(regcache_h) \
+	$(solib_svr4_h)
 lynx-nat.o: lynx-nat.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
 	$(gdbcore_h) $(regcache_h)
 m2-exp.o: m2-exp.c $(defs_h) $(gdb_string_h) $(expression_h) $(language_h) \
@@ -2148,11 +2158,12 @@ m32r-linux-nat.o: m32r-linux-nat.c $(def
 	$(gregset_h) $(m32r_tdep_h)
 m32r-linux-tdep.o: m32r-linux-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \
 	$(value_h) $(regcache_h) $(inferior_h) $(osabi_h) $(reggroups_h) \
-	$(gdb_string_h) $(glibc_tdep_h) $(solib_svr4_h) $(trad_frame_h) \
-	$(frame_unwind_h) $(regset_h) $(m32r_tdep_h)
-m32r-rom.o: m32r-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
-	$(serial_h) $(symtab_h) $(command_h) $(gdbcmd_h) $(symfile_h) \
-	$(gdb_string_h) $(objfiles_h) $(inferior_h) $(regcache_h)
+	$(regset_h) $(gdb_string_h) $(glibc_tdep_h) $(solib_svr4_h) \
+	$(trad_frame_h) $(frame_unwind_h) $(m32r_tdep_h)
+m32r-rom.o: m32r-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(exceptions_h) \
+	$(monitor_h) $(serial_h) $(symtab_h) $(command_h) $(gdbcmd_h) \
+	$(symfile_h) $(gdb_string_h) $(objfiles_h) $(inferior_h) \
+	$(regcache_h)
 m32r-stub.o: m32r-stub.c $(syscall_h)
 m32r-tdep.o: m32r-tdep.c $(defs_h) $(frame_h) $(frame_unwind_h) \
 	$(frame_base_h) $(symtab_h) $(gdbtypes_h) $(gdbcmd_h) $(gdbcore_h) \
@@ -2178,8 +2189,8 @@ m68klinux-nat.o: m68klinux-nat.c $(defs_
 m68klinux-tdep.o: m68klinux-tdep.c $(defs_h) $(gdbcore_h) $(doublest_h) \
 	$(floatformat_h) $(frame_h) $(target_h) $(gdb_string_h) \
 	$(gdbtypes_h) $(osabi_h) $(regcache_h) $(objfiles_h) $(symtab_h) \
-	$(m68k_tdep_h) $(trad_frame_h) $(frame_unwind_h) $(solib_svr4_h) \
-	$(glibc_tdep_h)
+	$(m68k_tdep_h) $(trad_frame_h) $(frame_unwind_h) $(glibc_tdep_h) \
+	$(solib_svr4_h)
 m68k-stub.o: m68k-stub.c
 m68k-tdep.o: m68k-tdep.c $(defs_h) $(dwarf2_frame_h) $(frame_h) \
 	$(frame_base_h) $(frame_unwind_h) $(floatformat_h) $(symtab_h) \
@@ -2202,16 +2213,11 @@ macrotab.o: macrotab.c $(defs_h) $(gdb_o
 	$(symtab_h) $(symfile_h) $(objfiles_h) $(macrotab_h) $(gdb_assert_h) \
 	$(bcache_h) $(complaints_h)
 main.o: main.c $(defs_h) $(top_h) $(target_h) $(inferior_h) $(symfile_h) \
-	$(gdbcore_h) $(getopt_h) $(gdb_stat_h) $(gdb_string_h) \
-	$(event_loop_h) $(ui_out_h) $(interps_h) $(main_h)
+	$(gdbcore_h) $(exceptions_h) $(getopt_h) $(gdb_stat_h) \
+	$(gdb_string_h) $(event_loop_h) $(ui_out_h) $(interps_h) $(main_h)
 maint.o: maint.c $(defs_h) $(command_h) $(gdbcmd_h) $(symtab_h) \
 	$(gdbtypes_h) $(demangle_h) $(gdbcore_h) $(expression_h) \
 	$(language_h) $(symfile_h) $(objfiles_h) $(value_h) $(cli_decode_h)
-mcore-rom.o: mcore-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
-	$(gdb_string_h) $(regcache_h) $(serial_h)
-mcore-tdep.o: mcore-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(value_h) \
-	$(gdbcmd_h) $(regcache_h) $(objfiles_h) $(gdbcore_h) $(inferior_h) \
-	$(arch_utils_h) $(gdb_string_h) $(disasm_h) $(dis_asm_h)
 mdebugread.o: mdebugread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \
 	$(objfiles_h) $(gdb_obstack_h) $(buildsym_h) $(stabsread_h) \
 	$(complaints_h) $(demangle_h) $(gdb_assert_h) $(block_h) \
@@ -2262,23 +2268,16 @@ mipsv4-nat.o: mipsv4-nat.c $(defs_h) $(i
 mn10300-tdep.o: mn10300-tdep.c $(defs_h) $(arch_utils_h) $(dis_asm_h) \
 	$(gdbtypes_h) $(regcache_h) $(gdb_string_h) $(gdb_assert_h) \
 	$(frame_h) $(frame_unwind_h) $(frame_base_h) $(trad_frame_h) \
-	$(symtab_h) $(dwarf2_frame_h) $(regcache_h)
-monitor.o: monitor.c $(defs_h) $(gdbcore_h) $(target_h) $(gdb_string_h) \
-	$(command_h) $(serial_h) $(monitor_h) $(gdbcmd_h) $(inferior_h) \
-	$(gdb_regex_h) $(srec_h) $(regcache_h)
+	$(symtab_h) $(dwarf2_frame_h) $(regcache_h) $(mn10300_tdep_h)
+monitor.o: monitor.c $(defs_h) $(gdbcore_h) $(target_h) $(exceptions_h) \
+	$(gdb_string_h) $(command_h) $(serial_h) $(monitor_h) $(gdbcmd_h) \
+	$(inferior_h) $(gdb_regex_h) $(srec_h) $(regcache_h)
 nbsd-tdep.o: nbsd-tdep.c $(defs_h) $(gdb_string_h) $(solib_svr4_h)
 nlmread.o: nlmread.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \
 	$(objfiles_h) $(buildsym_h) $(stabsread_h) $(block_h)
-ns32knbsd-nat.o: ns32knbsd-nat.c $(defs_h) $(inferior_h) $(target_h) \
-	$(gdbcore_h) $(regcache_h)
-ns32knbsd-tdep.o: ns32knbsd-tdep.c $(defs_h) $(osabi_h) $(ns32k_tdep_h) \
-	$(gdb_string_h)
-ns32k-tdep.o: ns32k-tdep.c $(defs_h) $(frame_h) $(gdbtypes_h) $(gdbcore_h) \
-	$(inferior_h) $(regcache_h) $(target_h) $(arch_utils_h) $(osabi_h) \
-	$(dis_asm_h) $(ns32k_tdep_h) $(gdb_string_h)
-nto-procfs.o: nto-procfs.c $(defs_h) $(gdb_dirent_h) $(gdb_string_h) \
-	$(gdbcore_h) $(inferior_h) $(target_h) $(objfiles_h) $(gdbthread_h) \
-	$(nto_tdep_h) $(command_h) $(regcache_h)
+nto-procfs.o: nto-procfs.c $(defs_h) $(gdb_dirent_h) $(exceptions_h) \
+	$(gdb_string_h) $(gdbcore_h) $(inferior_h) $(target_h) $(objfiles_h) \
+	$(gdbthread_h) $(nto_tdep_h) $(command_h) $(regcache_h)
 nto-tdep.o: nto-tdep.c $(gdb_stat_h) $(gdb_string_h) $(nto_tdep_h) $(top_h) \
 	$(cli_decode_h) $(cli_cmds_h) $(inferior_h) $(gdbarch_h) $(bfd_h) \
 	$(elf_bfd_h) $(solib_svr4_h) $(gdbcore_h)
@@ -2288,10 +2287,10 @@ objc-exp.o: objc-exp.c $(defs_h) $(gdb_s
 	$(block_h)
 objc-lang.o: objc-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \
 	$(parser_defs_h) $(language_h) $(c_lang_h) $(objc_lang_h) \
-	$(complaints_h) $(value_h) $(symfile_h) $(objfiles_h) \
-	$(gdb_string_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) $(frame_h) \
-	$(gdb_regex_h) $(regcache_h) $(block_h) $(infcall_h) $(valprint_h) \
-	$(gdb_assert_h)
+	$(exceptions_h) $(complaints_h) $(value_h) $(symfile_h) \
+	$(objfiles_h) $(gdb_string_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) \
+	$(frame_h) $(gdb_regex_h) $(regcache_h) $(block_h) $(infcall_h) \
+	$(valprint_h) $(gdb_assert_h)
 objfiles.o: objfiles.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \
 	$(objfiles_h) $(gdb_stabs_h) $(target_h) $(bcache_h) $(mdebugread_h) \
 	$(gdb_assert_h) $(gdb_stat_h) $(gdb_obstack_h) $(gdb_string_h) \
@@ -2299,13 +2298,14 @@ objfiles.o: objfiles.c $(defs_h) $(bfd_h
 observer.o: observer.c $(defs_h) $(observer_h) $(command_h) $(gdbcmd_h) \
 	$(observer_inc)
 ocd.o: ocd.c $(defs_h) $(gdbcore_h) $(gdb_string_h) $(frame_h) $(inferior_h) \
-	$(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) $(objfiles_h) \
-	$(gdb_stabs_h) $(serial_h) $(ocd_h) $(regcache_h)
+	$(bfd_h) $(symfile_h) $(target_h) $(exceptions_h) $(gdbcmd_h) \
+	$(objfiles_h) $(gdb_stabs_h) $(serial_h) $(ocd_h) $(regcache_h)
 osabi.o: osabi.c $(defs_h) $(gdb_assert_h) $(gdb_string_h) $(osabi_h) \
 	$(arch_utils_h) $(gdbcmd_h) $(command_h) $(elf_bfd_h)
-solib-pa64.o: solib-pa64.c $(defs_h) $(symtab_h) $(bfd_h) $(symfile_h) \
-	$(objfiles_h) $(gdbcore_h) $(target_h) $(inferior_h) $(hppa_tdep_h) \
-	$(solist_h) $(solib_pa64_h)
+pa64solib.o: pa64solib.c $(defs_h) $(frame_h) $(bfd_h) $(libhppa_h) \
+	$(gdbcore_h) $(symtab_h) $(breakpoint_h) $(symfile_h) $(objfiles_h) \
+	$(inferior_h) $(gdb_stabs_h) $(gdb_stat_h) $(gdbcmd_h) $(language_h) \
+	$(regcache_h) $(exec_h) $(hppa_tdep_h)
 parse.o: parse.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
 	$(frame_h) $(expression_h) $(value_h) $(command_h) $(language_h) \
 	$(parser_defs_h) $(gdbcmd_h) $(symfile_h) $(inferior_h) \
@@ -2374,25 +2374,27 @@ reggroups.o: reggroups.c $(defs_h) $(reg
 	$(gdb_assert_h) $(regcache_h) $(command_h) $(gdbcmd_h)
 regset.o: regset.c $(defs_h) $(regset_h) $(gdb_assert_h)
 remote.o: remote.c $(defs_h) $(gdb_string_h) $(inferior_h) $(bfd_h) \
-	$(symfile_h) $(target_h) $(gdbcmd_h) $(objfiles_h) $(gdb_stabs_h) \
-	$(gdbthread_h) $(remote_h) $(regcache_h) $(value_h) $(gdb_assert_h) \
-	$(event_loop_h) $(event_top_h) $(inf_loop_h) $(serial_h) \
-	$(gdbcore_h) $(remote_fileio_h)
+	$(symfile_h) $(exceptions_h) $(target_h) $(gdbcmd_h) $(objfiles_h) \
+	$(gdb_stabs_h) $(gdbthread_h) $(remote_h) $(regcache_h) $(value_h) \
+	$(gdb_assert_h) $(event_loop_h) $(event_top_h) $(inf_loop_h) \
+	$(serial_h) $(gdbcore_h) $(remote_fileio_h)
 remote-e7000.o: remote-e7000.c $(defs_h) $(gdbcore_h) $(gdbarch_h) \
 	$(inferior_h) $(target_h) $(value_h) $(command_h) $(gdb_string_h) \
-	$(gdbcmd_h) $(serial_h) $(remote_utils_h) $(symfile_h) $(regcache_h)
+	$(exceptions_h) $(gdbcmd_h) $(serial_h) $(remote_utils_h) \
+	$(symfile_h) $(regcache_h)
 remote-est.o: remote-est.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
 	$(serial_h) $(regcache_h) $(m68k_tdep_h)
 remote-fileio.o: remote-fileio.c $(defs_h) $(gdb_string_h) $(gdbcmd_h) \
 	$(remote_h) $(gdb_fileio_h) $(gdb_wait_h) $(gdb_stat_h) \
-	$(remote_fileio_h)
+	$(exceptions_h) $(remote_fileio_h)
 remote-hms.o: remote-hms.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
 	$(serial_h) $(regcache_h)
 remote-m32r-sdi.o: remote-m32r-sdi.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
 	$(inferior_h) $(target_h) $(regcache_h) $(gdb_string_h) $(serial_h)
 remote-mips.o: remote-mips.c $(defs_h) $(inferior_h) $(bfd_h) $(symfile_h) \
-	$(gdbcmd_h) $(gdbcore_h) $(serial_h) $(target_h) $(remote_utils_h) \
-	$(gdb_string_h) $(gdb_stat_h) $(regcache_h) $(mips_tdep_h)
+	$(gdbcmd_h) $(gdbcore_h) $(serial_h) $(target_h) $(exceptions_h) \
+	$(remote_utils_h) $(gdb_string_h) $(gdb_stat_h) $(regcache_h) \
+	$(mips_tdep_h)
 remote-rdi.o: remote-rdi.c $(defs_h) $(gdb_string_h) $(frame_h) \
 	$(inferior_h) $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) \
 	$(objfiles_h) $(gdb_stabs_h) $(gdbthread_h) $(gdbcore_h) \
@@ -2402,8 +2404,8 @@ remote-rdp.o: remote-rdp.c $(defs_h) $(i
 	$(gdb_callback_h) $(command_h) $(symfile_h) $(remote_utils_h) \
 	$(gdb_string_h) $(gdbcore_h) $(regcache_h) $(serial_h) $(arm_tdep_h)
 remote-sds.o: remote-sds.c $(defs_h) $(gdb_string_h) $(frame_h) \
-	$(inferior_h) $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) \
-	$(objfiles_h) $(gdb_stabs_h) $(gdbthread_h) $(gdbcore_h) \
+	$(inferior_h) $(exceptions_h) $(bfd_h) $(symfile_h) $(target_h) \
+	$(gdbcmd_h) $(objfiles_h) $(gdb_stabs_h) $(gdbthread_h) $(gdbcore_h) \
 	$(regcache_h) $(serial_h)
 remote-sim.o: remote-sim.c $(defs_h) $(inferior_h) $(value_h) \
 	$(gdb_string_h) $(terminal_h) $(target_h) $(gdbcore_h) \
@@ -2418,8 +2420,8 @@ rom68k-rom.o: rom68k-rom.c $(defs_h) $(g
 	$(serial_h) $(regcache_h) $(value_h) $(m68k_tdep_h)
 rs6000-nat.o: rs6000-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \
 	$(xcoffsolib_h) $(symfile_h) $(objfiles_h) $(libbfd_h) $(bfd_h) \
-	$(gdb_stabs_h) $(regcache_h) $(arch_utils_h) $(ppc_tdep_h) $(exec_h) \
-	$(gdb_stat_h)
+	$(exceptions_h) $(gdb_stabs_h) $(regcache_h) $(arch_utils_h) \
+	$(ppc_tdep_h) $(exec_h) $(gdb_stat_h)
 rs6000-tdep.o: rs6000-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \
 	$(target_h) $(gdbcore_h) $(gdbcmd_h) $(objfiles_h) $(arch_utils_h) \
 	$(regcache_h) $(regset_h) $(doublest_h) $(value_h) $(parser_defs_h) \
@@ -2480,18 +2482,25 @@ solib-aix5.o: solib-aix5.c $(defs_h) $(g
 	$(command_h) $(target_h) $(frame_h) $(gdb_regex_h) $(inferior_h) \
 	$(environ_h) $(language_h) $(gdbcmd_h) $(solist_h)
 solib.o: solib.c $(defs_h) $(gdb_string_h) $(symtab_h) $(bfd_h) $(symfile_h) \
-	$(objfiles_h) $(gdbcore_h) $(command_h) $(target_h) $(frame_h) \
-	$(gdb_regex_h) $(inferior_h) $(environ_h) $(language_h) $(gdbcmd_h) \
-	$(completer_h) $(filenames_h) $(exec_h) $(solist_h) $(observer_h) \
-	$(readline_h)
+	$(objfiles_h) $(exceptions_h) $(gdbcore_h) $(command_h) $(target_h) \
+	$(frame_h) $(gdb_regex_h) $(inferior_h) $(environ_h) $(language_h) \
+	$(gdbcmd_h) $(completer_h) $(filenames_h) $(exec_h) $(solist_h) \
+	$(observer_h) $(readline_h)
 solib-frv.o: solib-frv.c $(defs_h) $(gdb_string_h) $(inferior_h) \
 	$(gdbcore_h) $(solist_h) $(frv_tdep_h) $(objfiles_h) $(symtab_h) \
 	$(language_h) $(command_h) $(gdbcmd_h) $(elf_frv_h)
 solib-irix.o: solib-irix.c $(defs_h) $(symtab_h) $(bfd_h) $(symfile_h) \
 	$(objfiles_h) $(gdbcore_h) $(target_h) $(inferior_h) $(solist_h)
 solib-legacy.o: solib-legacy.c $(defs_h) $(gdbcore_h) $(solib_svr4_h)
+solib-null.o: solib-null.c $(defs_h) $(solist_h)
 solib-osf.o: solib-osf.c $(defs_h) $(gdb_string_h) $(bfd_h) $(symtab_h) \
 	$(symfile_h) $(objfiles_h) $(target_h) $(inferior_h) $(solist_h)
+solib-pa64.o: solib-pa64.c $(defs_h) $(symtab_h) $(bfd_h) $(symfile_h) \
+	$(objfiles_h) $(gdbcore_h) $(target_h) $(inferior_h) $(hppa_tdep_h) \
+	$(solist_h) $(solib_pa64_h)
+solib-som.o: solib-som.c $(defs_h) $(som_h) $(symtab_h) $(bfd_h) \
+	$(symfile_h) $(objfiles_h) $(gdbcore_h) $(target_h) $(inferior_h) \
+	$(hppa_tdep_h) $(solist_h)
 solib-sunos.o: solib-sunos.c $(defs_h) $(gdb_string_h) $(symtab_h) $(bfd_h) \
 	$(symfile_h) $(objfiles_h) $(gdbcore_h) $(inferior_h) $(solist_h) \
 	$(bcache_h) $(regcache_h)
@@ -2506,9 +2515,10 @@ somread.o: somread.c $(defs_h) $(bfd_h) 
 	$(objfiles_h) $(buildsym_h) $(stabsread_h) $(gdb_stabs_h) \
 	$(complaints_h) $(gdb_string_h) $(demangle_h) $(som_h) $(libhppa_h) \
 	$(solib_som_h)
-solib-som.o: solib-som.c $(defs_h) $(som_h) $(symtab_h) $(bfd_h) $(symfile_h) \
-	$(objfiles_h) $(gdbcore_h) $(target_h) $(inferior_h) $(hppa_tdep_h) \
-	$(solist_h)
+somsolib.o: somsolib.c $(defs_h) $(frame_h) $(bfd_h) $(som_h) $(libhppa_h) \
+	$(gdbcore_h) $(symtab_h) $(breakpoint_h) $(symfile_h) $(objfiles_h) \
+	$(inferior_h) $(gdb_stabs_h) $(gdb_stat_h) $(gdbcmd_h) $(language_h) \
+	$(regcache_h) $(gdb_assert_h) $(exec_h) $(hppa_tdep_h)
 source.o: source.c $(defs_h) $(symtab_h) $(expression_h) $(language_h) \
 	$(command_h) $(source_h) $(gdbcmd_h) $(frame_h) $(value_h) \
 	$(gdb_string_h) $(gdb_stat_h) $(gdbcore_h) $(gdb_regex_h) \
@@ -2580,7 +2590,8 @@ stack.o: stack.c $(defs_h) $(gdb_string_
 	$(gdbtypes_h) $(expression_h) $(language_h) $(frame_h) $(gdbcmd_h) \
 	$(gdbcore_h) $(target_h) $(source_h) $(breakpoint_h) $(demangle_h) \
 	$(inferior_h) $(annotate_h) $(ui_out_h) $(block_h) $(stack_h) \
-	$(gdb_assert_h) $(dictionary_h) $(reggroups_h) $(regcache_h)
+	$(gdb_assert_h) $(dictionary_h) $(exceptions_h) $(reggroups_h) \
+	$(regcache_h)
 std-regs.o: std-regs.c $(defs_h) $(user_regs_h) $(frame_h) $(gdbtypes_h) \
 	$(value_h) $(gdb_string_h)
 stop-gdb.o: stop-gdb.c $(defs_h)
@@ -2592,12 +2603,13 @@ symfile.o: symfile.c $(defs_h) $(bfdlink
 	$(hashtab_h) $(readline_h) $(gdb_assert_h) $(block_h) \
 	$(gdb_string_h) $(gdb_stat_h)
 symfile-mem.o: symfile-mem.c $(defs_h) $(symtab_h) $(gdbcore_h) \
-	$(objfiles_h) $(gdbcmd_h) $(target_h) $(value_h) $(symfile_h) \
-	$(observer_h) $(auxv_h) $(elf_common_h)
+	$(objfiles_h) $(exceptions_h) $(gdbcmd_h) $(target_h) $(value_h) \
+	$(symfile_h) $(observer_h) $(auxv_h) $(elf_common_h)
 symmisc.o: symmisc.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(bfd_h) \
 	$(symfile_h) $(objfiles_h) $(breakpoint_h) $(command_h) \
-	$(gdb_obstack_h) $(language_h) $(bcache_h) $(block_h) $(gdb_regex_h) \
-	$(dictionary_h) $(gdb_string_h) $(readline_h)
+	$(gdb_obstack_h) $(exceptions_h) $(language_h) $(bcache_h) \
+	$(block_h) $(gdb_regex_h) $(dictionary_h) $(gdb_string_h) \
+	$(readline_h)
 symtab.o: symtab.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \
 	$(frame_h) $(target_h) $(value_h) $(symfile_h) $(objfiles_h) \
 	$(gdbcmd_h) $(call_cmds_h) $(gdb_regex_h) $(expression_h) \
@@ -2609,19 +2621,17 @@ target.o: target.c $(defs_h) $(gdb_strin
 	$(symtab_h) $(inferior_h) $(bfd_h) $(symfile_h) $(objfiles_h) \
 	$(gdb_wait_h) $(dcache_h) $(regcache_h) $(gdb_assert_h) $(gdbcore_h)
 thread.o: thread.c $(defs_h) $(symtab_h) $(frame_h) $(inferior_h) \
-	$(environ_h) $(value_h) $(target_h) $(gdbthread_h) $(command_h) \
-	$(gdbcmd_h) $(regcache_h) $(gdb_h) $(gdb_string_h) $(ui_out_h)
-linux-thread-db.o: linux-thread-db.c $(defs_h) $(gdb_assert_h) \
-	$(gdb_proc_service_h) $(gdb_thread_db_h) $(bfd_h) $(gdbthread_h) \
-	$(inferior_h) $(symfile_h) $(objfiles_h) $(target_h) $(regcache_h) \
-	$(solib_svr4_h)
+	$(environ_h) $(value_h) $(target_h) $(gdbthread_h) $(exceptions_h) \
+	$(command_h) $(gdbcmd_h) $(regcache_h) $(gdb_h) $(gdb_string_h) \
+	$(ui_out_h)
 top.o: top.c $(defs_h) $(gdbcmd_h) $(call_cmds_h) $(cli_cmds_h) \
 	$(cli_script_h) $(cli_setshow_h) $(cli_decode_h) $(symtab_h) \
-	$(inferior_h) $(target_h) $(breakpoint_h) $(gdbtypes_h) \
-	$(expression_h) $(value_h) $(language_h) $(terminal_h) $(annotate_h) \
-	$(completer_h) $(top_h) $(version_h) $(serial_h) $(doublest_h) \
-	$(gdb_assert_h) $(readline_h) $(readline_history_h) $(event_top_h) \
-	$(gdb_string_h) $(gdb_stat_h) $(ui_out_h) $(cli_out_h)
+	$(inferior_h) $(exceptions_h) $(target_h) $(breakpoint_h) \
+	$(gdbtypes_h) $(expression_h) $(value_h) $(language_h) $(terminal_h) \
+	$(annotate_h) $(completer_h) $(top_h) $(version_h) $(serial_h) \
+	$(doublest_h) $(gdb_assert_h) $(readline_h) $(readline_history_h) \
+	$(event_top_h) $(gdb_string_h) $(gdb_stat_h) $(ui_out_h) \
+	$(cli_out_h)
 tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(gdbtypes_h) \
 	$(expression_h) $(gdbcmd_h) $(value_h) $(target_h) $(language_h) \
 	$(gdb_string_h) $(inferior_h) $(tracepoint_h) $(remote_h) \
@@ -2643,18 +2653,12 @@ ui-out.o: ui-out.c $(defs_h) $(gdb_strin
 user-regs.o: user-regs.c $(defs_h) $(user_regs_h) $(gdbtypes_h) \
 	$(gdb_string_h) $(gdb_assert_h) $(frame_h)
 utils.o: utils.c $(defs_h) $(gdb_assert_h) $(gdb_string_h) $(event_top_h) \
-	$(tui_h) $(gdbcmd_h) $(serial_h) $(bfd_h) $(target_h) $(demangle_h) \
-	$(expression_h) $(language_h) $(charset_h) $(annotate_h) \
-	$(filenames_h) $(symfile_h) $(inferior_h) $(gdb_curses_h) \
-	$(readline_h)
+	$(exceptions_h) $(tui_h) $(gdbcmd_h) $(serial_h) $(bfd_h) \
+	$(target_h) $(demangle_h) $(expression_h) $(language_h) $(charset_h) \
+	$(annotate_h) $(filenames_h) $(symfile_h) $(inferior_h) \
+	$(gdb_curses_h) $(readline_h)
 uw-thread.o: uw-thread.c $(defs_h) $(gdbthread_h) $(target_h) $(inferior_h) \
 	$(regcache_h) $(gregset_h)
-v850ice.o: v850ice.c $(defs_h) $(gdb_string_h) $(frame_h) $(symtab_h) \
-	$(inferior_h) $(breakpoint_h) $(symfile_h) $(target_h) $(objfiles_h) \
-	$(gdbcore_h) $(value_h) $(command_h) $(regcache_h)
-v850-tdep.o: v850-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
-	$(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) $(objfiles_h) \
-	$(arch_utils_h) $(regcache_h) $(symtab_h) $(dis_asm_h)
 valarith.o: valarith.c $(defs_h) $(value_h) $(symtab_h) $(gdbtypes_h) \
 	$(expression_h) $(target_h) $(language_h) $(gdb_string_h) \
 	$(doublest_h) $(infcall_h)
@@ -2683,15 +2687,16 @@ vax-tdep.o: vax-tdep.c $(defs_h) $(arch_
 	$(osabi_h) $(regcache_h) $(regset_h) $(trad_frame_h) $(value_h) \
 	$(gdb_string_h) $(vax_tdep_h)
 win32-nat.o: win32-nat.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
-	$(gdbcore_h) $(command_h) $(completer_h) $(regcache_h) $(top_h) \
-	$(buildsym_h) $(symfile_h) $(objfiles_h) $(gdb_string_h) \
-	$(gdbthread_h) $(gdbcmd_h) $(exec_h) $(i386_tdep_h) $(i387_tdep_h)
-wince.o: wince.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcore_h) \
-	$(command_h) $(buildsym_h) $(symfile_h) $(objfiles_h) \
-	$(gdb_string_h) $(gdbthread_h) $(gdbcmd_h) $(wince_stub_h) \
-	$(regcache_h) $(mips_tdep_h)
+	$(exceptions_h) $(gdbcore_h) $(command_h) $(completer_h) \
+	$(regcache_h) $(top_h) $(buildsym_h) $(symfile_h) $(objfiles_h) \
+	$(gdb_string_h) $(gdbthread_h) $(gdbcmd_h) $(exec_h) $(i386_tdep_h) \
+	$(i387_tdep_h)
+wince.o: wince.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
+	$(exceptions_h) $(gdbcore_h) $(command_h) $(buildsym_h) $(symfile_h) \
+	$(objfiles_h) $(gdb_string_h) $(gdbthread_h) $(gdbcmd_h) \
+	$(wince_stub_h) $(regcache_h) $(mips_tdep_h)
 wince-stub.o: wince-stub.c $(wince_stub_h)
-wrapper.o: wrapper.c $(defs_h) $(value_h) $(wrapper_h)
+wrapper.o: wrapper.c $(defs_h) $(value_h) $(exceptions_h) $(wrapper_h)
 xcoffread.o: xcoffread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(gdb_stat_h) \
 	$(coff_internal_h) $(libcoff_h) $(coff_xcoff_h) $(libxcoff_h) \
 	$(coff_rs6000_h) $(symtab_h) $(gdbtypes_h) $(symfile_h) \
@@ -2728,7 +2733,8 @@ cli-dump.o: $(srcdir)/cli/cli-dump.c $(d
 	$(cli_dump_h) $(gdb_assert_h) $(target_h) $(readline_h)
 	$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-dump.c
 cli-interp.o: $(srcdir)/cli/cli-interp.c $(defs_h) $(interps_h) $(wrapper_h) \
-	$(event_top_h) $(ui_out_h) $(cli_out_h) $(top_h) $(gdb_string_h)
+	$(event_top_h) $(ui_out_h) $(cli_out_h) $(top_h) $(gdb_string_h) \
+	$(exceptions_h)
 	$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-interp.c
 cli-logging.o: $(srcdir)/cli/cli-logging.c $(defs_h) $(gdbcmd_h) $(ui_out_h) \
 	$(gdb_string_h)
@@ -2936,10 +2942,10 @@ mi-interp.o: $(srcdir)/mi/mi-interp.c $(
 	$(mi_main_h) $(mi_cmds_h) $(mi_out_h) $(mi_console_h)
 	$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-interp.c
 mi-main.o: $(srcdir)/mi/mi-main.c $(defs_h) $(target_h) $(inferior_h) \
-	$(gdb_string_h) $(top_h) $(gdbthread_h) $(mi_cmds_h) $(mi_parse_h) \
-	$(mi_getopt_h) $(mi_console_h) $(ui_out_h) $(mi_out_h) $(interps_h) \
-	$(event_loop_h) $(event_top_h) $(gdbcore_h) $(value_h) $(regcache_h) \
-	$(gdb_h) $(frame_h) $(mi_main_h)
+	$(gdb_string_h) $(exceptions_h) $(top_h) $(gdbthread_h) $(mi_cmds_h) \
+	$(mi_parse_h) $(mi_getopt_h) $(mi_console_h) $(ui_out_h) $(mi_out_h) \
+	$(interps_h) $(event_loop_h) $(event_top_h) $(gdbcore_h) $(value_h) \
+	$(regcache_h) $(gdb_h) $(frame_h) $(mi_main_h)
 	$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-main.c
 mi-out.o: $(srcdir)/mi/mi-out.c $(defs_h) $(ui_out_h) $(mi_out_h)
 	$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-out.c
Index: ada-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.c,v
retrieving revision 1.65
diff -p -u -r1.65 ada-lang.c
--- ada-lang.c	21 Dec 2004 10:03:55 -0000	1.65
+++ ada-lang.c	12 Jan 2005 18:26:44 -0000
@@ -50,6 +50,7 @@ Foundation, Inc., 675 Mass Ave, Cambridg
 #include "block.h"
 #include "infcall.h"
 #include "dictionary.h"
+#include "exceptions.h"
 
 #ifndef ADA_RETAIN_DOTS
 #define ADA_RETAIN_DOTS 0
Index: ada-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-valprint.c,v
retrieving revision 1.16
diff -p -u -r1.16 ada-valprint.c
--- ada-valprint.c	5 Jan 2005 15:43:41 -0000	1.16
+++ ada-valprint.c	12 Jan 2005 18:26:44 -0000
@@ -33,6 +33,7 @@ Foundation, Inc., 675 Mass Ave, Cambridg
 #include "ada-lang.h"
 #include "c-lang.h"
 #include "infcall.h"
+#include "exceptions.h"
 
 /* Encapsulates arguments to ada_val_print.  */
 struct ada_val_print_args
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.187
diff -p -u -r1.187 breakpoint.c
--- breakpoint.c	4 Jan 2005 13:31:46 -0000	1.187
+++ breakpoint.c	12 Jan 2005 18:26:45 -0000
@@ -51,6 +51,7 @@
 #include "block.h"
 #include "solist.h"
 #include "observer.h"
+#include "exceptions.h"
 
 #include "gdb-events.h"
 
Index: corefile.c
===================================================================
RCS file: /cvs/src/src/gdb/corefile.c,v
retrieving revision 1.26
diff -p -u -r1.26 corefile.c
--- corefile.c	26 Jul 2004 14:52:59 -0000	1.26
+++ corefile.c	12 Jan 2005 18:26:45 -0000
@@ -35,6 +35,7 @@
 #include "dis-asm.h"
 #include "gdb_stat.h"
 #include "completer.h"
+#include "exceptions.h"
 
 /* Local function declarations.  */
 
Index: corelow.c
===================================================================
RCS file: /cvs/src/src/gdb/corelow.c,v
retrieving revision 1.43
diff -p -u -r1.43 corelow.c
--- corelow.c	29 Oct 2004 20:23:05 -0000	1.43
+++ corelow.c	12 Jan 2005 18:26:46 -0000
@@ -45,6 +45,7 @@
 #include "readline/readline.h"
 #include "observer.h"
 #include "gdb_assert.h"
+#include "exceptions.h"
 
 #ifndef O_BINARY
 #define O_BINARY 0
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.175
diff -p -u -r1.175 defs.h
--- defs.h	13 Nov 2004 17:00:04 -0000	1.175
+++ defs.h	12 Jan 2005 18:26:46 -0000
@@ -332,6 +332,8 @@ extern char *safe_strerror (int);
 
 extern void request_quit (int);
 
+#define	ALL_CLEANUPS	((struct cleanup *)0)
+
 extern void do_cleanups (struct cleanup *);
 extern void do_final_cleanups (struct cleanup *);
 extern void do_run_cleanups (struct cleanup *);
@@ -921,95 +923,6 @@ extern void internal_warning (const char
 
 extern NORETURN void nomem (long) ATTR_NORETURN;
 
-/* Reasons for calling throw_exception().  NOTE: all reason values
-   must be less than zero.  enum value 0 is reserved for internal use
-   as the return value from an initial setjmp().  The function
-   catch_exceptions() reserves values >= 0 as legal results from its
-   wrapped function.  */
-
-enum return_reason
-  {
-    /* User interrupt.  */
-    RETURN_QUIT = -2,
-    /* Any other error.  */
-    RETURN_ERROR
-  };
-
-#define	ALL_CLEANUPS	((struct cleanup *)0)
-
-#define RETURN_MASK(reason)	(1 << (int)(-reason))
-#define RETURN_MASK_QUIT	RETURN_MASK (RETURN_QUIT)
-#define RETURN_MASK_ERROR	RETURN_MASK (RETURN_ERROR)
-#define RETURN_MASK_ALL		(RETURN_MASK_QUIT | RETURN_MASK_ERROR)
-typedef int return_mask;
-
-/* Throw an exception of type RETURN_REASON.  Will execute a LONG JUMP
-   to the inner most containing exception handler established using
-   catch_exceptions() (or the legacy catch_errors()).
-
-   Code normally throws an exception using error() et.al.  For various
-   reaons, GDB also contains code that throws an exception directly.
-   For instance, the remote*.c targets contain CNTRL-C signal handlers
-   that propogate the QUIT event up the exception chain.  ``This could
-   be a good thing or a dangerous thing.'' -- the Existential Wombat.  */
-
-extern NORETURN void throw_exception (enum return_reason) ATTR_NORETURN;
-
-/* Call FUNC(UIOUT, FUNC_ARGS) but wrapped within an exception
-   handler.  If an exception (enum return_reason) is thrown using
-   throw_exception() than all cleanups installed since
-   catch_exceptions() was entered are invoked, the (-ve) exception
-   value is then returned by catch_exceptions.  If FUNC() returns
-   normally (with a postive or zero return value) then that value is
-   returned by catch_exceptions().  It is an internal_error() for
-   FUNC() to return a negative value.
-
-   For the period of the FUNC() call: UIOUT is installed as the output
-   builder; ERRSTRING is installed as the error/quit message; and a
-   new cleanup_chain is established.  The old values are restored
-   before catch_exceptions() returns.
-
-   The variant catch_exceptions_with_msg() is the same as
-   catch_exceptions() but adds the ability to return an allocated
-   copy of the gdb error message.  This is used when a silent error is 
-   issued and the caller wants to manually issue the error message.
-
-   FIXME; cagney/2001-08-13: The need to override the global UIOUT
-   builder variable should just go away.
-
-   This function superseeds catch_errors().
-
-   This function uses SETJMP() and LONGJUMP().  */
-
-struct ui_out;
-typedef int (catch_exceptions_ftype) (struct ui_out *ui_out, void *args);
-extern int catch_exceptions (struct ui_out *uiout,
-			     catch_exceptions_ftype *func, void *func_args,
-			     char *errstring, return_mask mask);
-extern int catch_exceptions_with_msg (struct ui_out *uiout,
-			     	      catch_exceptions_ftype *func, 
-			     	      void *func_args,
-			     	      char *errstring, char **gdberrmsg,
-				      return_mask mask);
-
-/* If CATCH_ERRORS_FTYPE throws an error, catch_errors() returns zero
-   otherwize the result from CATCH_ERRORS_FTYPE is returned. It is
-   probably useful for CATCH_ERRORS_FTYPE to always return a non-zero
-   value. It's unfortunate that, catch_errors() does not return an
-   indication of the exact exception that it caught - quit_flag might
-   help.
-
-   This function is superseeded by catch_exceptions().  */
-
-typedef int (catch_errors_ftype) (void *);
-extern int catch_errors (catch_errors_ftype *, void *, char *, return_mask);
-
-/* Template to catch_errors() that wraps calls to command
-   functions. */
-
-typedef void (catch_command_errors_ftype) (char *, int);
-extern int catch_command_errors (catch_command_errors_ftype *func, char *command, int from_tty, return_mask);
-
 extern void warning (const char *, ...) ATTR_FORMAT (printf, 1, 2);
 
 extern void vwarning (const char *, va_list args);
Index: event-loop.c
===================================================================
RCS file: /cvs/src/src/gdb/event-loop.c,v
retrieving revision 1.21
diff -p -u -r1.21 event-loop.c
--- event-loop.c	5 Nov 2002 21:17:33 -0000	1.21
+++ event-loop.c	12 Jan 2005 18:26:47 -0000
@@ -35,6 +35,7 @@
 #include "gdb_string.h"
 #include <errno.h>
 #include <sys/time.h>
+#include "exceptions.h"
 
 typedef struct gdb_event gdb_event;
 typedef void (event_handler_func) (int);
Index: event-top.c
===================================================================
RCS file: /cvs/src/src/gdb/event-top.c,v
retrieving revision 1.35
diff -p -u -r1.35 event-top.c
--- event-top.c	14 Oct 2004 12:44:24 -0000	1.35
+++ event-top.c	12 Jan 2005 18:26:47 -0000
@@ -28,6 +28,7 @@
 #include "event-top.h"
 #include "interps.h"
 #include <signal.h>
+#include "exceptions.h"
 
 /* For dont_repeat() */
 #include "gdbcmd.h"
Index: exceptions.c
===================================================================
RCS file: exceptions.c
diff -N exceptions.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ exceptions.c	12 Jan 2005 18:26:47 -0000
@@ -0,0 +1,313 @@
+/* Exception (throw catch) mechanism, for GDB, the GNU debugger.
+
+   Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+   Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "exceptions.h"
+#include <setjmp.h>
+#include "breakpoint.h"
+#include "target.h"
+#include "inferior.h"
+#include "annotate.h"
+#include "ui-out.h"
+#include "gdb_assert.h"
+
+/* One should use catch_errors rather than manipulating these
+   directly.  */
+#if defined(HAVE_SIGSETJMP)
+#define SIGJMP_BUF		sigjmp_buf
+#define SIGSETJMP(buf)		sigsetjmp((buf), 1)
+#define SIGLONGJMP(buf,val)	siglongjmp((buf), (val))
+#else
+#define SIGJMP_BUF		jmp_buf
+#define SIGSETJMP(buf)		setjmp(buf)
+#define SIGLONGJMP(buf,val)	longjmp((buf), (val))
+#endif
+
+/* Where to go for throw_exception().  */
+static SIGJMP_BUF *catch_return;
+
+/* Return for reason REASON to the nearest containing catch_errors().  */
+
+NORETURN void
+throw_exception (enum return_reason reason)
+{
+  quit_flag = 0;
+  immediate_quit = 0;
+
+  /* Perhaps it would be cleaner to do this via the cleanup chain (not sure
+     I can think of a reason why that is vital, though).  */
+  bpstat_clear_actions (stop_bpstat);	/* Clear queued breakpoint commands */
+
+  disable_current_display ();
+  do_cleanups (ALL_CLEANUPS);
+  if (target_can_async_p () && !target_executing)
+    do_exec_cleanups (ALL_CLEANUPS);
+  if (sync_execution)
+    do_exec_error_cleanups (ALL_CLEANUPS);
+
+  if (annotation_level > 1)
+    switch (reason)
+      {
+      case RETURN_QUIT:
+	annotate_quit ();
+	break;
+      case RETURN_ERROR:
+	annotate_error ();
+	break;
+      }
+
+  /* Jump to the containing catch_errors() call, communicating REASON
+     to that call via setjmp's return value.  Note that REASON can't
+     be zero, by definition in defs.h. */
+
+  (NORETURN void) SIGLONGJMP (*catch_return, (int) reason);
+}
+
+/* Call FUNC() with args FUNC_UIOUT and FUNC_ARGS, catching any
+   errors.  Set FUNC_CAUGHT to an ``enum return_reason'' if the
+   function is aborted (using throw_exception() or zero if the
+   function returns normally.  Set FUNC_VAL to the value returned by
+   the function or 0 if the function was aborted.
+
+   Must not be called with immediate_quit in effect (bad things might
+   happen, say we got a signal in the middle of a memcpy to quit_return).
+   This is an OK restriction; with very few exceptions immediate_quit can
+   be replaced by judicious use of QUIT.
+
+   MASK specifies what to catch; it is normally set to
+   RETURN_MASK_ALL, if for no other reason than that the code which
+   calls catch_errors might not be set up to deal with a quit which
+   isn't caught.  But if the code can deal with it, it generally
+   should be RETURN_MASK_ERROR, unless for some reason it is more
+   useful to abort only the portion of the operation inside the
+   catch_errors.  Note that quit should return to the command line
+   fairly quickly, even if some further processing is being done.  */
+
+/* MAYBE: cagney/1999-11-05: catch_errors() in conjunction with
+   error() et.al. could maintain a set of flags that indicate the the
+   current state of each of the longjmp buffers.  This would give the
+   longjmp code the chance to detect a longjmp botch (before it gets
+   to longjmperror()).  Prior to 1999-11-05 this wasn't possible as
+   code also randomly used a SET_TOP_LEVEL macro that directly
+   initialize the longjmp buffers. */
+
+/* MAYBE: cagney/1999-11-05: Should the catch_errors and cleanups code
+   be consolidated into a single file instead of being distributed
+   between utils.c and top.c? */
+
+static void
+catcher (catch_exceptions_ftype *func,
+	 struct ui_out *func_uiout,
+	 void *func_args,
+	 int *func_val,
+	 enum return_reason *func_caught,
+	 char *errstring,
+	 char **gdberrmsg,
+	 return_mask mask)
+{
+  SIGJMP_BUF *saved_catch;
+  SIGJMP_BUF catch;
+  struct cleanup *saved_cleanup_chain;
+  char *saved_error_pre_print;
+  char *saved_quit_pre_print;
+  struct ui_out *saved_uiout;
+
+  /* Return value from SIGSETJMP(): enum return_reason if error or
+     quit caught, 0 otherwise. */
+  int caught;
+
+  /* Return value from FUNC(): Hopefully non-zero. Explicitly set to
+     zero if an error quit was caught.  */
+  int val;
+
+  /* Override error/quit messages during FUNC. */
+
+  saved_error_pre_print = error_pre_print;
+  saved_quit_pre_print = quit_pre_print;
+
+  if (mask & RETURN_MASK_ERROR)
+    error_pre_print = errstring;
+  if (mask & RETURN_MASK_QUIT)
+    quit_pre_print = errstring;
+
+  /* Override the global ``struct ui_out'' builder.  */
+
+  saved_uiout = uiout;
+  uiout = func_uiout;
+
+  /* Prevent error/quit during FUNC from calling cleanups established
+     prior to here. */
+
+  saved_cleanup_chain = save_cleanups ();
+
+  /* Call FUNC, catching error/quit events. */
+
+  saved_catch = catch_return;
+  catch_return = &catch;
+  caught = SIGSETJMP (catch);
+  if (!caught)
+    val = (*func) (func_uiout, func_args);
+  else
+    {
+      val = 0;
+      /* If caller wants a copy of the low-level error message, make one.  
+         This is used in the case of a silent error whereby the caller
+         may optionally want to issue the message.  */
+      if (gdberrmsg)
+	*gdberrmsg = error_last_message ();
+    }
+  catch_return = saved_catch;
+
+  /* FIXME: cagney/1999-11-05: A correct FUNC implementation will
+     clean things up (restoring the cleanup chain) to the state they
+     were just prior to the call.  Unfortunately, many FUNC's are not
+     that well behaved.  This could be fixed by adding either a
+     do_cleanups call (to cover the problem) or an assertion check to
+     detect bad FUNCs code. */
+
+  /* Restore the cleanup chain, the error/quit messages, and the uiout
+     builder, to their original states. */
+
+  restore_cleanups (saved_cleanup_chain);
+
+  uiout = saved_uiout;
+
+  if (mask & RETURN_MASK_QUIT)
+    quit_pre_print = saved_quit_pre_print;
+  if (mask & RETURN_MASK_ERROR)
+    error_pre_print = saved_error_pre_print;
+
+  /* Return normally if no error/quit event occurred or this catcher
+     can handle this exception.  The caller analyses the func return
+     values.  */
+
+  if (!caught || (mask & RETURN_MASK (caught)))
+    {
+      *func_val = val;
+      *func_caught = caught;
+      return;
+    }
+
+  /* The caller didn't request that the event be caught, relay the
+     event to the next containing catch_errors(). */
+
+  throw_exception (caught);
+}
+
+int
+catch_exceptions (struct ui_out *uiout,
+		  catch_exceptions_ftype *func,
+		  void *func_args,
+		  char *errstring,
+		  return_mask mask)
+{
+  int val;
+  enum return_reason caught;
+  catcher (func, uiout, func_args, &val, &caught, errstring, NULL, mask);
+  gdb_assert (val >= 0);
+  gdb_assert (caught <= 0);
+  if (caught < 0)
+    return caught;
+  return val;
+}
+
+int
+catch_exceptions_with_msg (struct ui_out *uiout,
+		  	   catch_exceptions_ftype *func,
+		  	   void *func_args,
+		  	   char *errstring,
+			   char **gdberrmsg,
+		  	   return_mask mask)
+{
+  int val;
+  enum return_reason caught;
+  catcher (func, uiout, func_args, &val, &caught, errstring, gdberrmsg, mask);
+  gdb_assert (val >= 0);
+  gdb_assert (caught <= 0);
+  if (caught < 0)
+    return caught;
+  return val;
+}
+
+struct catch_errors_args
+{
+  catch_errors_ftype *func;
+  void *func_args;
+};
+
+static int
+do_catch_errors (struct ui_out *uiout, void *data)
+{
+  struct catch_errors_args *args = data;
+  return args->func (args->func_args);
+}
+
+int
+catch_errors (catch_errors_ftype *func, void *func_args, char *errstring,
+	      return_mask mask)
+{
+  int val;
+  enum return_reason caught;
+  struct catch_errors_args args;
+  args.func = func;
+  args.func_args = func_args;
+  catcher (do_catch_errors, uiout, &args, &val, &caught, errstring, 
+	   NULL, mask);
+  if (caught != 0)
+    return 0;
+  return val;
+}
+
+struct captured_command_args
+  {
+    catch_command_errors_ftype *command;
+    char *arg;
+    int from_tty;
+  };
+
+static int
+do_captured_command (void *data)
+{
+  struct captured_command_args *context = data;
+  context->command (context->arg, context->from_tty);
+  /* FIXME: cagney/1999-11-07: Technically this do_cleanups() call
+     isn't needed.  Instead an assertion check could be made that
+     simply confirmed that the called function correctly cleaned up
+     after itself.  Unfortunately, old code (prior to 1999-11-04) in
+     main.c was calling SET_TOP_LEVEL(), calling the command function,
+     and then *always* calling do_cleanups().  For the moment we
+     remain ``bug compatible'' with that old code..  */
+  do_cleanups (ALL_CLEANUPS);
+  return 1;
+}
+
+int
+catch_command_errors (catch_command_errors_ftype * command,
+		      char *arg, int from_tty, return_mask mask)
+{
+  struct captured_command_args args;
+  args.command = command;
+  args.arg = arg;
+  args.from_tty = from_tty;
+  return catch_errors (do_captured_command, &args, "", mask);
+}
Index: exceptions.h
===================================================================
RCS file: exceptions.h
diff -N exceptions.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ exceptions.h	12 Jan 2005 18:26:47 -0000
@@ -0,0 +1,114 @@
+/* Exception (throw catch) mechanism, for GDB, the GNU debugger.
+
+   Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+   Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef EXCEPTIONS_H
+#define EXCEPTIONS_H
+
+/* Reasons for calling throw_exception().  NOTE: all reason values
+   must be less than zero.  enum value 0 is reserved for internal use
+   as the return value from an initial setjmp().  The function
+   catch_exceptions() reserves values >= 0 as legal results from its
+   wrapped function.  */
+
+enum return_reason
+  {
+    /* User interrupt.  */
+    RETURN_QUIT = -2,
+    /* Any other error.  */
+    RETURN_ERROR
+  };
+
+#define RETURN_MASK(reason)	(1 << (int)(-reason))
+#define RETURN_MASK_QUIT	RETURN_MASK (RETURN_QUIT)
+#define RETURN_MASK_ERROR	RETURN_MASK (RETURN_ERROR)
+#define RETURN_MASK_ALL		(RETURN_MASK_QUIT | RETURN_MASK_ERROR)
+typedef int return_mask;
+
+/* Throw an exception of type RETURN_REASON.  Will execute a LONG JUMP
+   to the inner most containing exception handler established using
+   catch_exceptions() (or the legacy catch_errors()).
+
+   Code normally throws an exception using error() et.al.  For various
+   reaons, GDB also contains code that throws an exception directly.
+   For instance, the remote*.c targets contain CNTRL-C signal handlers
+   that propogate the QUIT event up the exception chain.  ``This could
+   be a good thing or a dangerous thing.'' -- the Existential Wombat.  */
+
+extern NORETURN void throw_exception (enum return_reason) ATTR_NORETURN;
+
+/* Call FUNC(UIOUT, FUNC_ARGS) but wrapped within an exception
+   handler.  If an exception (enum return_reason) is thrown using
+   throw_exception() than all cleanups installed since
+   catch_exceptions() was entered are invoked, the (-ve) exception
+   value is then returned by catch_exceptions.  If FUNC() returns
+   normally (with a postive or zero return value) then that value is
+   returned by catch_exceptions().  It is an internal_error() for
+   FUNC() to return a negative value.
+
+   For the period of the FUNC() call: UIOUT is installed as the output
+   builder; ERRSTRING is installed as the error/quit message; and a
+   new cleanup_chain is established.  The old values are restored
+   before catch_exceptions() returns.
+
+   The variant catch_exceptions_with_msg() is the same as
+   catch_exceptions() but adds the ability to return an allocated
+   copy of the gdb error message.  This is used when a silent error is 
+   issued and the caller wants to manually issue the error message.
+
+   FIXME; cagney/2001-08-13: The need to override the global UIOUT
+   builder variable should just go away.
+
+   This function superseeds catch_errors().
+
+   This function uses SETJMP() and LONGJUMP().  */
+
+struct ui_out;
+typedef int (catch_exceptions_ftype) (struct ui_out *ui_out, void *args);
+extern int catch_exceptions (struct ui_out *uiout,
+			     catch_exceptions_ftype *func, void *func_args,
+			     char *errstring, return_mask mask);
+extern int catch_exceptions_with_msg (struct ui_out *uiout,
+			     	      catch_exceptions_ftype *func, 
+			     	      void *func_args,
+			     	      char *errstring, char **gdberrmsg,
+				      return_mask mask);
+
+/* If CATCH_ERRORS_FTYPE throws an error, catch_errors() returns zero
+   otherwize the result from CATCH_ERRORS_FTYPE is returned. It is
+   probably useful for CATCH_ERRORS_FTYPE to always return a non-zero
+   value. It's unfortunate that, catch_errors() does not return an
+   indication of the exact exception that it caught - quit_flag might
+   help.
+
+   This function is superseeded by catch_exceptions().  */
+
+typedef int (catch_errors_ftype) (void *);
+extern int catch_errors (catch_errors_ftype *, void *, char *, return_mask);
+
+/* Template to catch_errors() that wraps calls to command
+   functions. */
+
+typedef void (catch_command_errors_ftype) (char *, int);
+extern int catch_command_errors (catch_command_errors_ftype *func, char *command, int from_tty, return_mask);
+
+#endif
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.197
diff -p -u -r1.197 frame.c
--- frame.c	12 Dec 2004 16:26:17 -0000	1.197
+++ frame.c	12 Jan 2005 18:26:47 -0000
@@ -41,6 +41,7 @@
 #include "gdbcmd.h"
 #include "observer.h"
 #include "objfiles.h"
+#include "exceptions.h"
 
 static struct frame_info *get_prev_frame_1 (struct frame_info *this_frame);
 
Index: hppa-hpux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-hpux-tdep.c,v
retrieving revision 1.38
diff -p -u -r1.38 hppa-hpux-tdep.c
--- hppa-hpux-tdep.c	19 Dec 2004 22:09:26 -0000	1.38
+++ hppa-hpux-tdep.c	12 Jan 2005 18:26:48 -0000
@@ -35,6 +35,7 @@
 #include "solib-som.h"
 #include "solib-pa64.h"
 #include "regset.h"
+#include "exceptions.h"
 
 #include "gdb_string.h"
 
Index: inf-loop.c
===================================================================
RCS file: /cvs/src/src/gdb/inf-loop.c,v
retrieving revision 1.1.1.3
diff -p -u -r1.1.1.3 inf-loop.c
--- inf-loop.c	7 Dec 1999 03:56:01 -0000	1.1.1.3
+++ inf-loop.c	12 Jan 2005 18:26:48 -0000
@@ -26,6 +26,7 @@
 #include "event-top.h"
 #include "inf-loop.h"
 #include "remote.h"
+#include "exceptions.h"
 
 static int fetch_inferior_event_wrapper (gdb_client_data client_data);
 static void complete_execution (void);
Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.185
diff -p -u -r1.185 infrun.c
--- infrun.c	24 Dec 2004 22:54:02 -0000	1.185
+++ infrun.c	12 Jan 2005 18:26:49 -0000
@@ -28,6 +28,7 @@
 #include "symtab.h"
 #include "frame.h"
 #include "inferior.h"
+#include "exceptions.h"
 #include "breakpoint.h"
 #include "gdb_wait.h"
 #include "gdbcore.h"
Index: m32r-rom.c
===================================================================
RCS file: /cvs/src/src/gdb/m32r-rom.c,v
retrieving revision 1.17
diff -p -u -r1.17 m32r-rom.c
--- m32r-rom.c	28 Jul 2004 19:42:00 -0000	1.17
+++ m32r-rom.c	12 Jan 2005 18:26:49 -0000
@@ -28,6 +28,7 @@
 #include "defs.h"
 #include "gdbcore.h"
 #include "target.h"
+#include "exceptions.h"
 #include "monitor.h"
 #include "serial.h"
 #include "symtab.h"
Index: main.c
===================================================================
RCS file: /cvs/src/src/gdb/main.c,v
retrieving revision 1.45
diff -p -u -r1.45 main.c
--- main.c	7 Dec 2004 11:06:03 -0000	1.45
+++ main.c	12 Jan 2005 18:26:49 -0000
@@ -28,6 +28,7 @@
 #include "symfile.h"
 #include "gdbcore.h"
 
+#include "exceptions.h"
 #include "getopt.h"
 
 #include <sys/types.h>
Index: monitor.c
===================================================================
RCS file: /cvs/src/src/gdb/monitor.c,v
retrieving revision 1.52
diff -p -u -r1.52 monitor.c
--- monitor.c	8 Oct 2004 20:29:47 -0000	1.52
+++ monitor.c	12 Jan 2005 18:26:50 -0000
@@ -43,6 +43,7 @@
 #include "defs.h"
 #include "gdbcore.h"
 #include "target.h"
+#include "exceptions.h"
 #include <signal.h>
 #include <ctype.h>
 #include "gdb_string.h"
Index: nto-procfs.c
===================================================================
RCS file: /cvs/src/src/gdb/nto-procfs.c,v
retrieving revision 1.7
diff -p -u -r1.7 nto-procfs.c
--- nto-procfs.c	10 Dec 2004 13:38:23 -0000	1.7
+++ nto-procfs.c	12 Jan 2005 18:26:50 -0000
@@ -33,6 +33,7 @@
 #include "gdb_dirent.h"
 #include <sys/netmgr.h>
 
+#include "exceptions.h"
 #include "gdb_string.h"
 #include "gdbcore.h"
 #include "inferior.h"
Index: objc-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/objc-lang.c,v
retrieving revision 1.40
diff -p -u -r1.40 objc-lang.c
--- objc-lang.c	12 Nov 2004 21:45:06 -0000	1.40
+++ objc-lang.c	12 Jan 2005 18:26:50 -0000
@@ -30,6 +30,7 @@
 #include "language.h"
 #include "c-lang.h"
 #include "objc-lang.h"
+#include "exceptions.h"
 #include "complaints.h"
 #include "value.h"
 #include "symfile.h"
Index: ocd.c
===================================================================
RCS file: /cvs/src/src/gdb/ocd.c,v
retrieving revision 1.32
diff -p -u -r1.32 ocd.c
--- ocd.c	29 Oct 2004 20:23:10 -0000	1.32
+++ ocd.c	12 Jan 2005 18:26:50 -0000
@@ -29,6 +29,7 @@
 #include "bfd.h"
 #include "symfile.h"
 #include "target.h"
+#include "exceptions.h"
 #include "gdbcmd.h"
 #include "objfiles.h"
 #include "gdb-stabs.h"
Index: remote-e7000.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-e7000.c,v
retrieving revision 1.47
diff -p -u -r1.47 remote-e7000.c
--- remote-e7000.c	29 Oct 2004 20:23:10 -0000	1.47
+++ remote-e7000.c	12 Jan 2005 18:26:51 -0000
@@ -43,6 +43,7 @@
 #include "value.h"
 #include "command.h"
 #include "gdb_string.h"
+#include "exceptions.h"
 #include "gdbcmd.h"
 #include <sys/types.h>
 #include "serial.h"
Index: remote-fileio.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-fileio.c,v
retrieving revision 1.6
diff -p -u -r1.6 remote-fileio.c
--- remote-fileio.c	27 Jan 2004 23:19:51 -0000	1.6
+++ remote-fileio.c	12 Jan 2005 18:26:51 -0000
@@ -28,6 +28,7 @@
 #include "gdb/fileio.h"
 #include "gdb_wait.h"
 #include "gdb_stat.h"
+#include "exceptions.h"
 #include "remote-fileio.h"
 
 #include <fcntl.h>
Index: remote-mips.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-mips.c,v
retrieving revision 1.56
diff -p -u -r1.56 remote-mips.c
--- remote-mips.c	31 Oct 2004 18:19:59 -0000	1.56
+++ remote-mips.c	12 Jan 2005 18:26:52 -0000
@@ -31,6 +31,7 @@
 #include "gdbcore.h"
 #include "serial.h"
 #include "target.h"
+#include "exceptions.h"
 #include "remote-utils.h"
 #include "gdb_string.h"
 #include "gdb_stat.h"
Index: remote-sds.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-sds.c,v
retrieving revision 1.34
diff -p -u -r1.34 remote-sds.c
--- remote-sds.c	8 Oct 2004 20:29:54 -0000	1.34
+++ remote-sds.c	12 Jan 2005 18:26:52 -0000
@@ -30,6 +30,7 @@
 #include <fcntl.h>
 #include "frame.h"
 #include "inferior.h"
+#include "exceptions.h"
 #include "bfd.h"
 #include "symfile.h"
 #include "target.h"
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.157
diff -p -u -r1.157 remote.c
--- remote.c	28 Dec 2004 09:06:10 -0000	1.157
+++ remote.c	12 Jan 2005 18:26:53 -0000
@@ -30,6 +30,7 @@
 #include "inferior.h"
 #include "bfd.h"
 #include "symfile.h"
+#include "exceptions.h"
 #include "target.h"
 /*#include "terminal.h" */
 #include "gdbcmd.h"
Index: rs6000-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-nat.c,v
retrieving revision 1.54
diff -p -u -r1.54 rs6000-nat.c
--- rs6000-nat.c	5 Oct 2004 21:53:33 -0000	1.54
+++ rs6000-nat.c	12 Jan 2005 18:26:53 -0000
@@ -30,6 +30,7 @@
 #include "objfiles.h"
 #include "libbfd.h"		/* For bfd_default_set_arch_mach (FIXME) */
 #include "bfd.h"
+#include "exceptions.h"
 #include "gdb-stabs.h"
 #include "regcache.h"
 #include "arch-utils.h"
Index: solib.c
===================================================================
RCS file: /cvs/src/src/gdb/solib.c,v
retrieving revision 1.68
diff -p -u -r1.68 solib.c
--- solib.c	11 Sep 2004 10:24:50 -0000	1.68
+++ solib.c	12 Jan 2005 18:26:53 -0000
@@ -29,6 +29,7 @@
 #include "bfd.h"
 #include "symfile.h"
 #include "objfiles.h"
+#include "exceptions.h"
 #include "gdbcore.h"
 #include "command.h"
 #include "target.h"
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.119
diff -p -u -r1.119 stack.c
--- stack.c	12 Nov 2004 21:45:07 -0000	1.119
+++ stack.c	12 Jan 2005 18:26:54 -0000
@@ -43,6 +43,7 @@
 #include "stack.h"
 #include "gdb_assert.h"
 #include "dictionary.h"
+#include "exceptions.h"
 #include "reggroups.h"
 #include "regcache.h"
 
Index: symfile-mem.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile-mem.c,v
retrieving revision 1.4
diff -p -u -r1.4 symfile-mem.c
--- symfile-mem.c	7 Nov 2004 21:33:29 -0000	1.4
+++ symfile-mem.c	12 Jan 2005 18:26:54 -0000
@@ -48,6 +48,7 @@
 #include "symtab.h"
 #include "gdbcore.h"
 #include "objfiles.h"
+#include "exceptions.h"
 #include "gdbcmd.h"
 #include "target.h"
 #include "value.h"
Index: symmisc.c
===================================================================
RCS file: /cvs/src/src/gdb/symmisc.c,v
retrieving revision 1.33
diff -p -u -r1.33 symmisc.c
--- symmisc.c	10 Aug 2004 21:52:05 -0000	1.33
+++ symmisc.c	12 Jan 2005 18:26:54 -0000
@@ -30,6 +30,7 @@
 #include "breakpoint.h"
 #include "command.h"
 #include "gdb_obstack.h"
+#include "exceptions.h"
 #include "language.h"
 #include "bcache.h"
 #include "block.h"
Index: thread.c
===================================================================
RCS file: /cvs/src/src/gdb/thread.c,v
retrieving revision 1.39
diff -p -u -r1.39 thread.c
--- thread.c	29 Oct 2004 20:23:13 -0000	1.39
+++ thread.c	12 Jan 2005 18:26:54 -0000
@@ -30,6 +30,7 @@
 #include "value.h"
 #include "target.h"
 #include "gdbthread.h"
+#include "exceptions.h"
 #include "command.h"
 #include "gdbcmd.h"
 #include "regcache.h"
Index: top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.94
diff -p -u -r1.94 top.c
--- top.c	14 Oct 2004 12:44:23 -0000	1.94
+++ top.c	12 Jan 2005 18:26:54 -0000
@@ -30,6 +30,7 @@
 #include "cli/cli-decode.h"
 #include "symtab.h"
 #include "inferior.h"
+#include "exceptions.h"
 #include <signal.h>
 #include "target.h"
 #include "breakpoint.h"
@@ -55,8 +56,6 @@
 
 #include <sys/types.h>
 
-#include <setjmp.h>
-
 #include "event-top.h"
 #include "gdb_string.h"
 #include "gdb_stat.h"
@@ -291,289 +290,6 @@ void (*deprecated_context_hook) (int id)
    middle of the GUI.  Usually used in conjunction with a catch routine.  */
 
 void (*deprecated_error_hook) (void);
-
-
-/* One should use catch_errors rather than manipulating these
-   directly.  */
-#if defined(HAVE_SIGSETJMP)
-#define SIGJMP_BUF		sigjmp_buf
-#define SIGSETJMP(buf)		sigsetjmp((buf), 1)
-#define SIGLONGJMP(buf,val)	siglongjmp((buf), (val))
-#else
-#define SIGJMP_BUF		jmp_buf
-#define SIGSETJMP(buf)		setjmp(buf)
-#define SIGLONGJMP(buf,val)	longjmp((buf), (val))
-#endif
-
-/* Where to go for throw_exception().  */
-static SIGJMP_BUF *catch_return;
-
-/* Return for reason REASON to the nearest containing catch_errors().  */
-
-NORETURN void
-throw_exception (enum return_reason reason)
-{
-  quit_flag = 0;
-  immediate_quit = 0;
-
-  /* Perhaps it would be cleaner to do this via the cleanup chain (not sure
-     I can think of a reason why that is vital, though).  */
-  bpstat_clear_actions (stop_bpstat);	/* Clear queued breakpoint commands */
-
-  disable_current_display ();
-  do_cleanups (ALL_CLEANUPS);
-  if (target_can_async_p () && !target_executing)
-    do_exec_cleanups (ALL_CLEANUPS);
-  if (sync_execution)
-    do_exec_error_cleanups (ALL_CLEANUPS);
-
-  if (annotation_level > 1)
-    switch (reason)
-      {
-      case RETURN_QUIT:
-	annotate_quit ();
-	break;
-      case RETURN_ERROR:
-	annotate_error ();
-	break;
-      }
-
-  /* Jump to the containing catch_errors() call, communicating REASON
-     to that call via setjmp's return value.  Note that REASON can't
-     be zero, by definition in defs.h. */
-
-  (NORETURN void) SIGLONGJMP (*catch_return, (int) reason);
-}
-
-/* Call FUNC() with args FUNC_UIOUT and FUNC_ARGS, catching any
-   errors.  Set FUNC_CAUGHT to an ``enum return_reason'' if the
-   function is aborted (using throw_exception() or zero if the
-   function returns normally.  Set FUNC_VAL to the value returned by
-   the function or 0 if the function was aborted.
-
-   Must not be called with immediate_quit in effect (bad things might
-   happen, say we got a signal in the middle of a memcpy to quit_return).
-   This is an OK restriction; with very few exceptions immediate_quit can
-   be replaced by judicious use of QUIT.
-
-   MASK specifies what to catch; it is normally set to
-   RETURN_MASK_ALL, if for no other reason than that the code which
-   calls catch_errors might not be set up to deal with a quit which
-   isn't caught.  But if the code can deal with it, it generally
-   should be RETURN_MASK_ERROR, unless for some reason it is more
-   useful to abort only the portion of the operation inside the
-   catch_errors.  Note that quit should return to the command line
-   fairly quickly, even if some further processing is being done.  */
-
-/* MAYBE: cagney/1999-11-05: catch_errors() in conjunction with
-   error() et.al. could maintain a set of flags that indicate the the
-   current state of each of the longjmp buffers.  This would give the
-   longjmp code the chance to detect a longjmp botch (before it gets
-   to longjmperror()).  Prior to 1999-11-05 this wasn't possible as
-   code also randomly used a SET_TOP_LEVEL macro that directly
-   initialize the longjmp buffers. */
-
-/* MAYBE: cagney/1999-11-05: Should the catch_errors and cleanups code
-   be consolidated into a single file instead of being distributed
-   between utils.c and top.c? */
-
-static void
-catcher (catch_exceptions_ftype *func,
-	 struct ui_out *func_uiout,
-	 void *func_args,
-	 int *func_val,
-	 enum return_reason *func_caught,
-	 char *errstring,
-	 char **gdberrmsg,
-	 return_mask mask)
-{
-  SIGJMP_BUF *saved_catch;
-  SIGJMP_BUF catch;
-  struct cleanup *saved_cleanup_chain;
-  char *saved_error_pre_print;
-  char *saved_quit_pre_print;
-  struct ui_out *saved_uiout;
-
-  /* Return value from SIGSETJMP(): enum return_reason if error or
-     quit caught, 0 otherwise. */
-  int caught;
-
-  /* Return value from FUNC(): Hopefully non-zero. Explicitly set to
-     zero if an error quit was caught.  */
-  int val;
-
-  /* Override error/quit messages during FUNC. */
-
-  saved_error_pre_print = error_pre_print;
-  saved_quit_pre_print = quit_pre_print;
-
-  if (mask & RETURN_MASK_ERROR)
-    error_pre_print = errstring;
-  if (mask & RETURN_MASK_QUIT)
-    quit_pre_print = errstring;
-
-  /* Override the global ``struct ui_out'' builder.  */
-
-  saved_uiout = uiout;
-  uiout = func_uiout;
-
-  /* Prevent error/quit during FUNC from calling cleanups established
-     prior to here. */
-
-  saved_cleanup_chain = save_cleanups ();
-
-  /* Call FUNC, catching error/quit events. */
-
-  saved_catch = catch_return;
-  catch_return = &catch;
-  caught = SIGSETJMP (catch);
-  if (!caught)
-    val = (*func) (func_uiout, func_args);
-  else
-    {
-      val = 0;
-      /* If caller wants a copy of the low-level error message, make one.  
-         This is used in the case of a silent error whereby the caller
-         may optionally want to issue the message.  */
-      if (gdberrmsg)
-	*gdberrmsg = error_last_message ();
-    }
-  catch_return = saved_catch;
-
-  /* FIXME: cagney/1999-11-05: A correct FUNC implementation will
-     clean things up (restoring the cleanup chain) to the state they
-     were just prior to the call.  Unfortunately, many FUNC's are not
-     that well behaved.  This could be fixed by adding either a
-     do_cleanups call (to cover the problem) or an assertion check to
-     detect bad FUNCs code. */
-
-  /* Restore the cleanup chain, the error/quit messages, and the uiout
-     builder, to their original states. */
-
-  restore_cleanups (saved_cleanup_chain);
-
-  uiout = saved_uiout;
-
-  if (mask & RETURN_MASK_QUIT)
-    quit_pre_print = saved_quit_pre_print;
-  if (mask & RETURN_MASK_ERROR)
-    error_pre_print = saved_error_pre_print;
-
-  /* Return normally if no error/quit event occurred or this catcher
-     can handle this exception.  The caller analyses the func return
-     values.  */
-
-  if (!caught || (mask & RETURN_MASK (caught)))
-    {
-      *func_val = val;
-      *func_caught = caught;
-      return;
-    }
-
-  /* The caller didn't request that the event be caught, relay the
-     event to the next containing catch_errors(). */
-
-  throw_exception (caught);
-}
-
-int
-catch_exceptions (struct ui_out *uiout,
-		  catch_exceptions_ftype *func,
-		  void *func_args,
-		  char *errstring,
-		  return_mask mask)
-{
-  int val;
-  enum return_reason caught;
-  catcher (func, uiout, func_args, &val, &caught, errstring, NULL, mask);
-  gdb_assert (val >= 0);
-  gdb_assert (caught <= 0);
-  if (caught < 0)
-    return caught;
-  return val;
-}
-
-int
-catch_exceptions_with_msg (struct ui_out *uiout,
-		  	   catch_exceptions_ftype *func,
-		  	   void *func_args,
-		  	   char *errstring,
-			   char **gdberrmsg,
-		  	   return_mask mask)
-{
-  int val;
-  enum return_reason caught;
-  catcher (func, uiout, func_args, &val, &caught, errstring, gdberrmsg, mask);
-  gdb_assert (val >= 0);
-  gdb_assert (caught <= 0);
-  if (caught < 0)
-    return caught;
-  return val;
-}
-
-struct catch_errors_args
-{
-  catch_errors_ftype *func;
-  void *func_args;
-};
-
-static int
-do_catch_errors (struct ui_out *uiout, void *data)
-{
-  struct catch_errors_args *args = data;
-  return args->func (args->func_args);
-}
-
-int
-catch_errors (catch_errors_ftype *func, void *func_args, char *errstring,
-	      return_mask mask)
-{
-  int val;
-  enum return_reason caught;
-  struct catch_errors_args args;
-  args.func = func;
-  args.func_args = func_args;
-  catcher (do_catch_errors, uiout, &args, &val, &caught, errstring, 
-	   NULL, mask);
-  if (caught != 0)
-    return 0;
-  return val;
-}
-
-struct captured_command_args
-  {
-    catch_command_errors_ftype *command;
-    char *arg;
-    int from_tty;
-  };
-
-static int
-do_captured_command (void *data)
-{
-  struct captured_command_args *context = data;
-  context->command (context->arg, context->from_tty);
-  /* FIXME: cagney/1999-11-07: Technically this do_cleanups() call
-     isn't needed.  Instead an assertion check could be made that
-     simply confirmed that the called function correctly cleaned up
-     after itself.  Unfortunately, old code (prior to 1999-11-04) in
-     main.c was calling SET_TOP_LEVEL(), calling the command function,
-     and then *always* calling do_cleanups().  For the moment we
-     remain ``bug compatible'' with that old code..  */
-  do_cleanups (ALL_CLEANUPS);
-  return 1;
-}
-
-int
-catch_command_errors (catch_command_errors_ftype * command,
-		      char *arg, int from_tty, return_mask mask)
-{
-  struct captured_command_args args;
-  args.command = command;
-  args.arg = arg;
-  args.from_tty = from_tty;
-  return catch_errors (do_captured_command, &args, "", mask);
-}
-
 
 /* Handler for SIGHUP.  */
 
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.139
diff -p -u -r1.139 utils.c
--- utils.c	9 Nov 2004 00:59:03 -0000	1.139
+++ utils.c	12 Jan 2005 18:26:55 -0000
@@ -26,6 +26,7 @@
 #include <ctype.h>
 #include "gdb_string.h"
 #include "event-top.h"
+#include "exceptions.h"
 
 #ifdef TUI
 #include "tui/tui.h"		/* For tui_get_command_dimension.   */
Index: win32-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/win32-nat.c,v
retrieving revision 1.101
diff -p -u -r1.101 win32-nat.c
--- win32-nat.c	8 Oct 2004 20:29:56 -0000	1.101
+++ win32-nat.c	12 Jan 2005 18:26:55 -0000
@@ -30,6 +30,7 @@
 #include "frame.h"		/* required by inferior.h */
 #include "inferior.h"
 #include "target.h"
+#include "exceptions.h"
 #include "gdbcore.h"
 #include "command.h"
 #include "completer.h"
Index: wince.c
===================================================================
RCS file: /cvs/src/src/gdb/wince.c,v
retrieving revision 1.36
diff -p -u -r1.36 wince.c
--- wince.c	8 Oct 2004 20:30:00 -0000	1.36
+++ wince.c	12 Jan 2005 18:26:55 -0000
@@ -34,6 +34,7 @@
 #include "frame.h"		/* required by inferior.h */
 #include "inferior.h"
 #include "target.h"
+#include "exceptions.h"
 #include "gdbcore.h"
 #include "command.h"
 #include <signal.h>
Index: wrapper.c
===================================================================
RCS file: /cvs/src/src/gdb/wrapper.c,v
retrieving revision 1.14
diff -p -u -r1.14 wrapper.c
--- wrapper.c	31 Oct 2001 03:16:04 -0000	1.14
+++ wrapper.c	12 Jan 2005 18:26:55 -0000
@@ -18,6 +18,7 @@
 
 #include "defs.h"
 #include "value.h"
+#include "exceptions.h"
 #include "wrapper.h"
 
 /* Use this struct to pass arguments to wrapper routines. We assume
Index: cli/cli-interp.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-interp.c,v
retrieving revision 1.4
diff -p -u -r1.4 cli-interp.c
--- cli/cli-interp.c	3 Jul 2003 14:49:26 -0000	1.4
+++ cli/cli-interp.c	12 Jan 2005 18:26:56 -0000
@@ -27,6 +27,7 @@
 #include "cli-out.h"
 #include "top.h"		/* for "execute_command" */
 #include "gdb_string.h"
+#include "exceptions.h"
 
 struct ui_out *cli_uiout;
 
Index: mi/mi-main.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-main.c,v
retrieving revision 1.67
diff -p -u -r1.67 mi-main.c
--- mi/mi-main.c	12 Nov 2004 21:45:08 -0000	1.67
+++ mi/mi-main.c	12 Jan 2005 18:26:56 -0000
@@ -28,6 +28,7 @@
 #include "target.h"
 #include "inferior.h"
 #include "gdb_string.h"
+#include "exceptions.h"
 #include "top.h"
 #include "gdbthread.h"
 #include "mi-cmds.h"
Index: tui/tui-interp.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-interp.c,v
retrieving revision 1.5
diff -p -u -r1.5 tui-interp.c
--- tui/tui-interp.c	7 Feb 2004 04:40:36 -0000	1.5
+++ tui/tui-interp.c	12 Jan 2005 18:26:57 -0000
@@ -31,6 +31,7 @@
 #include "tui/tui-win.h"
 #include "tui/tui.h"
 #include "tui/tui-io.h"
+#include "exceptions.h"
 
 /* Set to 1 when the TUI mode must be activated when we first start gdb.  */
 static int tui_start_enabled = 0;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]