This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Update get_args documentation
- From: Keith Seitz <kseitz at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 27 Feb 2018 20:54:08 -0000
- Subject: [binutils-gdb] Update get_args documentation
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e05cac70d855cd404eae9aeea5fcfb83ce8aabcf
commit e05cac70d855cd404eae9aeea5fcfb83ce8aabcf
Author: Phil Muldoon <pmuldoon@redhat.com>
Date: Tue Feb 27 12:21:23 2018 -0800
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.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/compile/compile.c | 22 +++++++++++++++++++---
2 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 33fbaac..9b899e5 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 82e63d8..70c4570d 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,