binutils-gdb/gdb/mi
Tom Tromey 94aeb44b00 Make exception handling more efficient
This makes exception handling more efficient in a few spots, through
the use of const- and rvalue-references.

I wrote this patch by commenting out the gdb_exception copy
constructor and then examining the resulting error messages one by
one, introducing the use of std::move where appropriate.

gdb/ChangeLog
2019-04-25  Tom Tromey  <tromey@adacore.com>

	* xml-support.c (struct gdb_xml_parser) <set_error>: Take an
	rvalue reference.
	(gdb_xml_start_element_wrapper, gdb_xml_end_element_wrapper)
	(gdb_xml_parser::parse): Use std::move.
	* python/python-internal.h (gdbpy_convert_exception): Take a const
	reference.
	* python/py-value.c (valpy_getitem, valpy_nonzero): Use
	std::move.
	* python/py-utils.c (gdbpy_convert_exception): Take a const
	reference.
	* python/py-inferior.c (infpy_write_memory, infpy_search_memory):
	Use std::move.
	* python/py-breakpoint.c (bppy_set_condition, bppy_set_commands):
	Use std::move.
	* mi/mi-main.c (mi_print_exception): Take a const reference.
	* main.c (handle_command_errors): Take a const reference.
	* linespec.c (parse_linespec): Use std::move.
	* infcall.c (run_inferior_call): Use std::move.
	(call_function_by_hand_dummy): Use std::move.
	* exec.c (try_open_exec_file): Use std::move.
	* exceptions.h (exception_print, exception_fprintf)
	(exception_print_same): Update.
	* exceptions.c (print_exception, exception_print)
	(exception_fprintf, exception_print_same): Change parameters to
	const reference.
	* event-top.c (gdb_rl_callback_read_char_wrapper): Update.
	* common/new-op.c: Use std::move.
	* common/common-exceptions.h (struct gdb_exception): Add move
	constructor.
	(struct gdb_exception_error, struct gdb_exception_quit, struct
	gdb_quit_bad_alloc): Change constructor to move constructor.
	(throw_exception): Change parameter to rvalue reference.
	* common/common-exceptions.c (throw_exception): Take rvalue
	reference.
	* cli/cli-interp.c (safe_execute_command): Use std::move.
	* breakpoint.c (insert_bp_location, location_to_sals): Use
	std::move.
2019-04-25 12:59:35 -06:00
..
ChangeLog-1999-2003
mi-cmd-break.c Rename gdb exception types 2019-04-08 09:05:40 -06:00
mi-cmd-break.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
mi-cmd-catch.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
mi-cmd-disas.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
mi-cmd-env.c Normalize includes to use common/ 2019-01-25 15:28:16 -07:00
mi-cmd-file.c Add compunits range adapter to objfile 2019-01-17 15:42:05 -07:00
mi-cmd-info.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
mi-cmd-stack.c Rename gdb exception types 2019-04-08 09:05:40 -06:00
mi-cmd-target.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
mi-cmd-var.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
mi-cmds.c Fix MI output for multi-location breakpoints 2019-03-13 15:14:36 -04:00
mi-cmds.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
mi-common.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
mi-common.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
mi-console.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
mi-console.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
mi-getopt.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
mi-getopt.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
mi-interp.c Remove exception_none 2019-04-25 12:59:35 -06:00
mi-interp.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
mi-main.c Make exception handling more efficient 2019-04-25 12:59:35 -06:00
mi-main.h Fix MI output for multi-location breakpoints 2019-03-13 15:14:36 -04:00
mi-out.c Fix MI output for multi-location breakpoints 2019-03-13 15:14:36 -04:00
mi-out.h Factor out mi_ui_out instantiation logic 2019-03-13 13:26:37 -04:00
mi-parse.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
mi-parse.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
mi-symbol-cmds.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00