From patchwork Thu Feb 22 22:46:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Seitz X-Patchwork-Id: 26016 Received: (qmail 25989 invoked by alias); 22 Feb 2018 22:46:20 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 25942 invoked by uid 89); 22 Feb 2018 22:46:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:1878 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 Feb 2018 22:46:16 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7EC2E81DE5 for ; Thu, 22 Feb 2018 22:46:15 +0000 (UTC) Received: from theo.uglyboxes.com (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2FBC660BE3; Thu, 22 Feb 2018 22:46:15 +0000 (UTC) From: Keith Seitz To: gdb-patches@sourceware.org Cc: Phil Muldoon Subject: [PATCH] Update documentation for get_args Date: Thu, 22 Feb 2018 14:46:14 -0800 Message-Id: <20180222224614.5120-1-keiths@redhat.com> X-IsSubscribed: yes From: Phil Muldoon 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. --- gdb/compile/compile.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c index 82e63d895f..b9a40ed32a 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 compiler-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,