binutils-gdb/gdb/common
Tom Tromey 3d6e9d2336 Make exceptions use std::string and be self-managing
This changes the exception's "message" member to be a shared_ptr
wrapping a std::string.  This allows removing the stack of exception
messages, because now exceptions will self-destruct when needed.  This
also adds a noexcept copy constructor and operator= to gdb_exception,
plus a "what" method.

gdb/ChangeLog
2019-04-08  Tom Tromey  <tom@tromey.com>

	* xml-support.c (gdb_xml_parser::parse): Update.
	* x86-linux-nat.c (x86_linux_nat_target::enable_btrace): Update.
	* value.c (show_convenience): Update.
	* unittests/cli-utils-selftests.c (test_number_or_range_parser)
	(test_parse_flags_qcs): Update.
	* thread.c (thr_try_catch_cmd): Update.
	* target.c (target_translate_tls_address): Update.
	* stack.c (print_frame_arg, read_frame_local, read_frame_arg)
	(info_frame_command_core, frame_apply_command_count): Update.
	* rust-exp.y (rust_lex_exception_test): Update.
	* riscv-tdep.c (riscv_print_one_register_info): Update.
	* remote.c (remote_target::enable_btrace): Update.
	* record-btrace.c (record_btrace_enable_warn): Update.
	* python/py-utils.c (gdbpy_convert_exception): Update.
	* printcmd.c (do_one_display, print_variable_and_value): Update.
	* mi/mi-main.c (mi_print_exception): Update.
	* mi/mi-interp.c (mi_cmd_interpreter_exec): Use SCOPE_EXIT.
	* mi/mi-cmd-stack.c (list_arg_or_local): Update.
	* linux-nat.c (linux_nat_target::attach): Update.
	* linux-fork.c (class scoped_switch_fork_info): Update.
	* infrun.c (displaced_step_prepare): Update.
	* infcall.c (call_function_by_hand_dummy): Update.
	* guile/scm-exception.c (gdbscm_scm_from_gdb_exception): Update.
	* gnu-v3-abi.c (print_one_vtable): Update.
	* frame.c (get_prev_frame_always): Update.
	* f-valprint.c (info_common_command_for_block): Update.
	* exec.c (try_open_exec_file): Update.
	* exceptions.c (print_exception, exception_print)
	(exception_fprintf, exception_print_same): Update.
	* dwarf2-frame.c (dwarf2_build_frame_info): Update.
	* dwarf-index-cache.c (index_cache::store)
	(index_cache::lookup_gdb_index): Update.
	* darwin-nat.c (maybe_cache_shell): Update.
	* cp-valprint.c (cp_print_value_fields): Update.
	* compile/compile-cplus-symbols.c (gcc_cplus_convert_symbol)
	(gcc_cplus_symbol_address): Update.
	* compile/compile-c-symbols.c (gcc_convert_symbol)
	(gcc_symbol_address, generate_c_for_for_one_variable): Update.
	* common/selftest.c: Update.
	* common/common-exceptions.h (struct gdb_exception) <message>: Now
	a std::string.
	(exception_try_scope_entry, exception_try_scope_exit): Don't
	declare.
	(struct exception_try_scope): Remove.
	(TRY): Don't use exception_try_scope.
	(struct gdb_exception): Add constructor, operator=.
	<what>: New method.
	(struct gdb_exception_RETURN_MASK_ALL)
	(struct gdb_exception_RETURN_MASK_ERROR)
	(struct gdb_exception_RETURN_MASK_QUIT): Add constructor.
	(struct gdb_quit_bad_alloc): Update.
	* common/common-exceptions.c (exception_none): Change
	initializer.
	(struct catcher) <state, exception>: Initialize inline.
	<prev>: Remove member.
	(current_catcher): Remove.
	(catchers): New global.
	(exceptions_state_mc_init): Simplify.
	(catcher_pop): Remove.
	(exceptions_state_mc, exceptions_state_mc_catch): Update.
	(try_scope_depth, exception_try_scope_entry)
	(exception_try_scope_exit): Remove.
	(throw_exception_sjlj): Update.
	(exception_messages, exception_messages_size): Remove.
	(throw_it): Simplify.
	(gdb_exception_sliced_copy): Remove.
	(throw_exception_cxx): Update.
	* cli/cli-script.c (script_from_file): Update.
	* breakpoint.c (insert_bp_location, update_breakpoint_locations):
	Update.
	* ada-valprint.c (ada_val_print): Update.
	* ada-lang.c (ada_to_fixed_type_1, ada_exception_name_addr)
	(create_excep_cond_exprs): Update.

gdb/gdbserver/ChangeLog
2019-04-08  Tom Tromey  <tom@tromey.com>

	* server.c (handle_btrace_general_set, handle_qxfer_btrace)
	(handle_qxfer_btrace_conf, detach_or_kill_for_exit_cleanup)
	(captured_main, main): Update.
	* gdbreplay.c (main): Update.
2019-04-08 09:05:38 -06:00
..
agent.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
agent.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
array-view.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
ax.def Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
break-common.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
btrace-common.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
btrace-common.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
buffer.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
buffer.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
byte-vector.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
cleanups.c Remove basic cleanup code 2019-03-06 16:04:31 -07:00
cleanups.h Remove basic cleanup code 2019-03-06 16:04:31 -07:00
common-debug.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
common-debug.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
common-defs.h Introduce ATTRIBUTE_UNUSED_RESULT and use it 2019-03-05 08:48:39 -07:00
common-exceptions.c Make exceptions use std::string and be self-managing 2019-04-08 09:05:38 -06:00
common-exceptions.h Make exceptions use std::string and be self-managing 2019-04-08 09:05:38 -06:00
common-gdbthread.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
common-inferior.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
common-regcache.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
common-regcache.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
common-types.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
common-utils.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
common-utils.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
common.host Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
common.m4 Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
create-version.sh Update create-version.sh to use common/version.h 2019-01-25 15:28:16 -07:00
def-vector.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
default-init-alloc.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
enum-flags.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
environ.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
environ.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
errors.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
errors.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
fileio.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
fileio.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
filestuff.c Remove last cleanup from linux-namespaces.c 2019-03-06 16:04:31 -07:00
filestuff.h Remove last cleanup from linux-namespaces.c 2019-03-06 16:04:31 -07:00
filtered-iterator.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
format.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
format.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
forward-scope-exit.h Fix clang/libc++ build 2019-01-24 18:01:49 +00:00
function-view.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
gdb_assert.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gdb_locale.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gdb_optional.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gdb_proc_service.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
gdb_ref_ptr.h Add ATTRIBUTE_UNUSED_RESULT to ref_ptr::release 2019-03-05 08:48:40 -07:00
gdb_setjmp.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gdb_signals.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
gdb_splay_tree.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gdb_string_view.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gdb_string_view.tcc Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
gdb_sys_time.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gdb_tilde_expand.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
gdb_tilde_expand.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gdb_unique_ptr.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gdb_unlinker.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gdb_vecs.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
gdb_vecs.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gdb_wait.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
hash_enum.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
host-defs.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
job-control.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
job-control.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
mingw-strerror.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
netstuff.c Fix GDB compilation on MinGW (PR gdb/24292) 2019-03-02 15:13:54 +02:00
netstuff.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
new-op.c Remove basic cleanup code 2019-03-06 16:04:31 -07:00
next-iterator.h Remove ALL_OBJFILES_SAFE 2019-01-09 18:28:14 -07:00
observable.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
offset-type.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
pathstuff.c Add a new function child_path. 2019-02-12 13:56:16 -08:00
pathstuff.h Add a new function child_path. 2019-02-12 13:56:16 -08:00
poison.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
posix-strerror.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
preprocessor.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
print-utils.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
print-utils.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
ptid.c Make null_ptid and minus_one_ptid "const" 2019-03-12 10:45:37 -06:00
ptid.h Make null_ptid and minus_one_ptid "const" 2019-03-12 10:45:37 -06:00
queue.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
refcounted-object.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
rsp-low.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
rsp-low.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
run-time-clock.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
run-time-clock.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
safe-iterator.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
scope-exit.h Introduce scope_exit 2019-01-23 19:02:58 +00:00
scoped_fd.h Add ATTRIBUTE_UNUSED_RESULT to scoped_fd 2019-03-05 08:48:40 -07:00
scoped_mmap.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
scoped_mmap.h Add ATTRIBUTE_UNUSED_RESULT to scoped_mmap 2019-03-05 08:48:40 -07:00
scoped_restore.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
selftest.c Make exceptions use std::string and be self-managing 2019-04-08 09:05:38 -06:00
selftest.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
signals-state-save-restore.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
signals-state-save-restore.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
signals.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
symbol.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
tdesc.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
tdesc.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
traits.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
underlying.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
valid-expr.h Rename ESC -> ESC_PARENS 2019-01-23 18:58:28 +00:00
vec.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
vec.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
version.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
x86-xstate.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
xml-utils.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
xml-utils.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00