Return unique_xmalloc_ptr for generate_c_for_variable_locations
[deliverable/binutils-gdb.git] / gdb / compile / compile.c
index 82e63d895f5342c63481754170d746e138ee693a..01c0bc4b391eb5d0bdbaea305568f2d7165d56e1 100644 (file)
@@ -41,6 +41,7 @@
 #include "valprint.h"
 #include "common/gdb_optional.h"
 #include "common/gdb_unlinker.h"
+#include "common/pathstuff.h"
 
 \f
 
@@ -148,7 +149,7 @@ compile_code_command (const char *arg, int from_tty)
     eval_compile_command (NULL, arg, scope, NULL);
   else
     {
-      command_line_up l = get_command_line (compile_control, "");
+      counted_command_line l = get_command_line (compile_control, "");
 
       l->control_u.compile.scope = scope;
       execute_control_command_untraced (l.get ());
@@ -186,7 +187,7 @@ compile_print_command (const char *arg, int from_tty)
     eval_compile_command (NULL, arg, scope, &fmt);
   else
     {
-      command_line_up l = get_command_line (compile_control, "");
+      counted_command_line l = get_command_line (compile_control, "");
 
       l->control_u.compile.scope = scope;
       l->control_u.compile.scope_data = &fmt;
@@ -393,9 +394,25 @@ filter_args (int *argcp, char **argv)
   *destv = NULL;
 }
 
-/* Produce final vector of GCC compilation options.  First element is target
-   size ("-m64", "-m32" etc.), optionally followed by DW_AT_producer options
-   and then compile-args string GDB variable.  */
+/* Produce final vector of GCC compilation options.
+
+   The first element of the combined argument vector are arguments
+   relating to the target size ("-m64", "-m32" etc.).  These are
+   sourced from the inferior's architecture.
+
+   The second element of the combined argument vector are arguments
+   stored in the inferior DW_AT_producer section.  If these are stored
+   in the inferior (there is no guarantee that they are), they are
+   added to the vector.
+
+   The third element of the combined argument vector are argument
+   supplied by the language implementation provided by
+   compile-{lang}-support.  These contain language specific arguments.
+
+   The final element of the combined argument vector are arguments
+   supplied by the "set compile-args" command.  These are always
+   appended last so as to override any of the arguments automatically
+   generated above.  */
 
 static void
 get_args (const struct compile_instance *compiler, struct gdbarch *gdbarch,
@@ -495,7 +512,7 @@ compile_to_object (struct command_line *cmd, const char *cmd_string,
     {
       struct command_line *iter;
 
-      for (iter = cmd->body_list[0]; iter; iter = iter->next)
+      for (iter = cmd->body_list_0.get (); iter; iter = iter->next)
        {
          input_buf.puts (iter->line);
          input_buf.puts ("\n");
This page took 0.024989 seconds and 4 git commands to generate.