diff options
Diffstat (limited to 'gdb/compile')
-rw-r--r-- | gdb/compile/compile-internal.h | 3 | ||||
-rw-r--r-- | gdb/compile/compile.c | 12 |
2 files changed, 8 insertions, 7 deletions
diff --git a/gdb/compile/compile-internal.h b/gdb/compile/compile-internal.h index dbded02..49ddbd4 100644 --- a/gdb/compile/compile-internal.h +++ b/gdb/compile/compile-internal.h @@ -96,7 +96,8 @@ public: /* Set compilation arguments. REGEXP is only used for protocol version GCC_FE_VERSION_0. */ - char *set_arguments (int argc, char **argv, const char *regexp = NULL); + gdb::unique_xmalloc_ptr<char> set_arguments (int argc, char **argv, + const char *regexp = NULL); /* Set the filename of the program to compile. Nop for GCC_FE_VERSION_0. */ void set_source_file (const char *filename); diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c index 074a865..4e72adc 100644 --- a/gdb/compile/compile.c +++ b/gdb/compile/compile.c @@ -714,9 +714,8 @@ compile_to_object (struct command_line *cmd, const char *cmd_string, int argc = argv_holder.count (); char **argv = argv_holder.get (); - gdb::unique_xmalloc_ptr<char> error_message; - error_message.reset (compiler->set_arguments (argc, argv, - triplet_rx.c_str ())); + gdb::unique_xmalloc_ptr<char> error_message + = compiler->set_arguments (argc, argv, triplet_rx.c_str ()); if (error_message != NULL) error ("%s", error_message.get ()); @@ -882,13 +881,14 @@ compile_instance::set_triplet_regexp (const char *regexp) /* See compile-internal.h. */ -char * +gdb::unique_xmalloc_ptr<char> compile_instance::set_arguments (int argc, char **argv, const char *regexp) { if (version () >= GCC_FE_VERSION_1) - return FORWARD (set_arguments, argc, argv); + return gdb::unique_xmalloc_ptr<char> (FORWARD (set_arguments, argc, argv)); else - return FORWARD (set_arguments_v0, regexp, argc, argv); + return gdb::unique_xmalloc_ptr<char> (FORWARD (set_arguments_v0, regexp, + argc, argv)); } /* See compile-internal.h. */ |