gdb::{unique_ptr,move} -> std::{unique_ptr,move}

Now that we require C++11, use std::unique_ptr and std::move directly.

gdb/ChangeLog:
2016-11-15  Pedro Alves  <palves@redhat.com>

	* ada-lang.c (create_excep_cond_exprs): Use std::move instead of
	gdb::move.
	* break-catch-throw.c (handle_gnu_v3_exceptions): Use
	std::unique_ptr instead of gdb::unique_ptr.
	* breakpoint.c (watch_command_1): Use std::move instead of
	gdb::move.
	* cli/cli-dump.c (dump_memory_to_file, restore_binary_file): Use
	std::unique_ptr instead of gdb::unique_ptr.
	* dtrace-probe.c (dtrace_process_dof_probe): Use std::move instead
	of gdb::move.
	* elfread.c (elf_read_minimal_symbols): Use std::unique_ptr
	instead of gdb::unique_ptr.
	* mi/mi-main.c (mi_cmd_data_read_memory): Use std::unique_ptr
	instead of gdb::unique_ptr.
	* parse.c (parse_expression_for_completion): Use std::move instead
	of gdb::move.
	* printcmd.c (display_command): std::move instead of gdb::move.
This commit is contained in:
Pedro Alves 2016-11-15 19:54:21 +00:00
parent b7f38fdae7
commit b22e99fdaf
10 changed files with 31 additions and 11 deletions

View file

@ -1,3 +1,23 @@
2016-11-15 Pedro Alves <palves@redhat.com>
* ada-lang.c (create_excep_cond_exprs): Use std::move instead of
gdb::move.
* break-catch-throw.c (handle_gnu_v3_exceptions): Use
std::unique_ptr instead of gdb::unique_ptr.
* breakpoint.c (watch_command_1): Use std::move instead of
gdb::move.
* cli/cli-dump.c (dump_memory_to_file, restore_binary_file): Use
std::unique_ptr instead of gdb::unique_ptr.
* dtrace-probe.c (dtrace_process_dof_probe): Use std::move instead
of gdb::move.
* elfread.c (elf_read_minimal_symbols): Use std::unique_ptr
instead of gdb::unique_ptr.
* mi/mi-main.c (mi_cmd_data_read_memory): Use std::unique_ptr
instead of gdb::unique_ptr.
* parse.c (parse_expression_for_completion): Use std::move instead
of gdb::move.
* printcmd.c (display_command): std::move instead of gdb::move.
2016-11-14 Markus Metzger <markus.t.metzger@intel.com> 2016-11-14 Markus Metzger <markus.t.metzger@intel.com>
* nat/linux-btrace.c (perf_event_read): Allow data_head < size. * nat/linux-btrace.c (perf_event_read): Allow data_head < size.

View file

@ -12347,7 +12347,7 @@ create_excep_cond_exprs (struct ada_catchpoint *c)
s = cond_string; s = cond_string;
TRY TRY
{ {
exp = gdb::move (parse_exp_1 (&s, bl->address, exp = std::move (parse_exp_1 (&s, bl->address,
block_for_pc (bl->address), block_for_pc (bl->address),
0)); 0));
} }
@ -12360,7 +12360,7 @@ create_excep_cond_exprs (struct ada_catchpoint *c)
END_CATCH END_CATCH
} }
ada_loc->excep_cond_expr = gdb::move (exp); ada_loc->excep_cond_expr = std::move (exp);
} }
do_cleanups (old_chain); do_cleanups (old_chain);

View file

@ -399,7 +399,7 @@ handle_gnu_v3_exceptions (int tempflag, char *except_rx, char *cond_string,
_("invalid type-matching regexp")); _("invalid type-matching regexp"));
} }
gdb::unique_ptr<exception_catchpoint> cp (new exception_catchpoint ()); std::unique_ptr<exception_catchpoint> cp (new exception_catchpoint ());
init_catchpoint (&cp->base, get_current_arch (), tempflag, cond_string, init_catchpoint (&cp->base, get_current_arch (), tempflag, cond_string,
&gnu_v3_exception_catchpoint_ops); &gnu_v3_exception_catchpoint_ops);

View file

@ -11378,7 +11378,7 @@ watch_command_1 (const char *arg, int accessflag, int from_tty,
b->thread = thread; b->thread = thread;
b->disposition = disp_donttouch; b->disposition = disp_donttouch;
b->pspace = current_program_space; b->pspace = current_program_space;
w->exp = gdb::move (exp); w->exp = std::move (exp);
w->exp_valid_block = exp_valid_block; w->exp_valid_block = exp_valid_block;
w->cond_exp_valid_block = cond_exp_valid_block; w->cond_exp_valid_block = cond_exp_valid_block;
if (just_location) if (just_location)

View file

@ -236,7 +236,7 @@ dump_memory_to_file (const char *cmd, const char *mode, const char *file_format)
/* FIXME: Should use read_memory_partial() and a magic blocking /* FIXME: Should use read_memory_partial() and a magic blocking
value. */ value. */
gdb::unique_ptr<gdb_byte[]> buf (new gdb_byte[count]); std::unique_ptr<gdb_byte[]> buf (new gdb_byte[count]);
read_memory (lo, buf.get (), count); read_memory (lo, buf.get (), count);
/* Have everything. Open/write the data. */ /* Have everything. Open/write the data. */
@ -550,7 +550,7 @@ restore_binary_file (const char *filename, struct callback_data *data)
perror_with_name (filename); perror_with_name (filename);
/* Now allocate a buffer and read the file contents. */ /* Now allocate a buffer and read the file contents. */
gdb::unique_ptr<gdb_byte[]> buf (new gdb_byte[len]); std::unique_ptr<gdb_byte[]> buf (new gdb_byte[len]);
if (fread (buf.get (), 1, len, file) != len) if (fread (buf.get (), 1, len, file) != len)
perror_with_name (filename); perror_with_name (filename);

View file

@ -430,7 +430,7 @@ dtrace_process_dof_probe (struct objfile *objfile,
TRY TRY
{ {
expr = gdb::move (parse_expression_with_language (arg.type_str, expr = std::move (parse_expression_with_language (arg.type_str,
language_c)); language_c));
} }
CATCH (ex, RETURN_MASK_ERROR) CATCH (ex, RETURN_MASK_ERROR)

View file

@ -1136,7 +1136,7 @@ elf_read_minimal_symbols (struct objfile *objfile, int symfile_flags,
{ {
long i; long i;
gdb::unique_ptr<asymbol *[]> std::unique_ptr<asymbol *[]>
synth_symbol_table (new asymbol *[synthcount]); synth_symbol_table (new asymbol *[synthcount]);
for (i = 0; i < synthcount; i++) for (i = 0; i < synthcount; i++)
synth_symbol_table[i] = synthsyms + i; synth_symbol_table[i] = synthsyms + i;

View file

@ -1504,7 +1504,7 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc)
/* Create a buffer and read it in. */ /* Create a buffer and read it in. */
total_bytes = word_size * nr_rows * nr_cols; total_bytes = word_size * nr_rows * nr_cols;
gdb::unique_ptr<gdb_byte[]> mbuf (new gdb_byte[total_bytes]); std::unique_ptr<gdb_byte[]> mbuf (new gdb_byte[total_bytes]);
/* Dispatch memory reads to the topmost target, not the flattened /* Dispatch memory reads to the topmost target, not the flattened
current_target. */ current_target. */

View file

@ -1309,7 +1309,7 @@ parse_expression_for_completion (const char *string, char **name,
TRY TRY
{ {
parse_completion = 1; parse_completion = 1;
exp = gdb::move (parse_exp_in_context (&string, 0, 0, 0, 0, &subexp)); exp = std::move (parse_exp_in_context (&string, 0, 0, 0, 0, &subexp));
} }
CATCH (except, RETURN_MASK_ERROR) CATCH (except, RETURN_MASK_ERROR)
{ {

View file

@ -1779,7 +1779,7 @@ display_command (char *arg, int from_tty)
newobj = new display (); newobj = new display ();
newobj->exp_string = xstrdup (exp); newobj->exp_string = xstrdup (exp);
newobj->exp = gdb::move (expr); newobj->exp = std::move (expr);
newobj->block = innermost_block; newobj->block = innermost_block;
newobj->pspace = current_program_space; newobj->pspace = current_program_space;
newobj->number = ++display_number; newobj->number = ++display_number;