summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Muldoon <pmuldoon@redhat.com>2018-02-27 12:21:23 -0800
committerKeith Seitz <keiths@redhat.com>2018-02-27 12:53:41 -0800
commite05cac70d855cd404eae9aeea5fcfb83ce8aabcf (patch)
tree78539264f88d940c067d7832c666c090556bc616
parentf6aec96dce1ddbd8961a3aa8a2925db2021719bb (diff)
downloadbinutils-gdb-e05cac70d855cd404eae9aeea5fcfb83ce8aabcf.tar.gz
Update get_args documentation
This patch adds argument compilation documentation, expanding on the already existing comments, giving a more thorough explanation of the source of the arguments used in the final argument string. gdb/ChangeLog: * compile/compile.c (get_args): Add additional comments explaining function.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/compile/compile.c22
2 files changed, 24 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 33fbaac63b0..9b899e54d32 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2018-02-27 Phil Muldoon <pmuldoon@redhat.com>
+
+ * compile/compile.c (get_args): Add additional comments
+ explaining function.
+
2018-02-27 Simon Marchi <simon.marchi@polymtl.ca>
Tom Tromey <tom@tromey.com>
diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c
index 82e63d895f5..70c4570de7d 100644
--- a/gdb/compile/compile.c
+++ b/gdb/compile/compile.c
@@ -393,9 +393,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,