From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117956 invoked by alias); 17 May 2015 19:30:57 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 117922 invoked by uid 89); 17 May 2015 19:30:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 17 May 2015 19:30:55 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4HJUsi0005979 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Sun, 17 May 2015 15:30:54 -0400 Received: from host1.jankratochvil.net (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4HJUoCb017321 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 17 May 2015 15:30:53 -0400 Date: Sun, 17 May 2015 19:30:00 -0000 From: Jan Kratochvil To: gdb@sourceware.org Cc: Phil Muldoon Subject: compile: new libcc1 API proposal Message-ID: <20150517193050.GA8148@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="17pEHd4RhPHOinZp" Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg00020.txt.bz2 --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 367 Hi, as discussed in threads around [PATCH v2 1/2] compile: set debug compile: Display GCC driver filename https://sourceware.org/ml/gdb-patches/2015-04/msg00909.html [PATCH v3 2/2] compile: Add 'set compile-gcc' https://sourceware.org/ml/gdb-patches/2015-04/msg00915.html here is new libcc1 API proposal, before it gets (re)implemented and posted to GCC. Jan --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=1 Content-length: 4947 diff --git a/include/gcc-interface.h b/include/gcc-interface.h index df7db6e..cd9dfce 100644 --- a/include/gcc-interface.h +++ b/include/gcc-interface.h @@ -44,7 +44,12 @@ struct gcc_base_context; enum gcc_base_api_version { - GCC_FE_VERSION_0 = 0 + GCC_FE_VERSION_0 = 0, + + /* Deprecated methods set_arguments_v0 and compile_v0. Added methods + set_arguments, set_triplet_regexp, set_driver_filename, set_verbose and + compile. */ + GCC_FE_VERSION_1 = 1, }; /* The operations defined by the GCC base API. This is the vtable for @@ -64,20 +69,12 @@ struct gcc_base_vtable unsigned int version; - /* Set the compiler's command-line options for the next compilation. - TRIPLET_REGEXP is a regular expression that is used to match the - configury triplet prefix to the compiler. - The arguments are copied by GCC. ARGV need not be - NULL-terminated. The arguments must be set separately for each - compilation; that is, after a compile is requested, the - previously-set arguments cannot be reused. + /* Deprecated GCC_FE_VERSION_0 variant of the GCC_FE_VERSION_1 + methods set_triplet_regexp and set_arguments. */ - This returns NULL on success. On failure, returns a malloc()d - error message. The caller is responsible for freeing it. */ - - char *(*set_arguments) (struct gcc_base_context *self, - const char *triplet_regexp, - int argc, char **argv); + char *(*set_arguments_v0) (struct gcc_base_context *self, + const char *triplet_regexp, + int argc, char **argv); /* Set the file name of the program to compile. The string is copied by the method implementation, but the caller must @@ -93,18 +90,74 @@ struct gcc_base_vtable const char *message), void *datum); - /* Perform the compilation. FILENAME is the name of the resulting - object file. VERBOSE can be set to cause GCC to print some - information as it works. Returns true on success, false on - error. */ + /* Deprecated GCC_FE_VERSION_0 variant of the GCC_FE_VERSION_1 + compile method. GCC_FE_VERSION_0 version verbose parameter has + been replaced by the set_verbose method. */ - int /* bool */ (*compile) (struct gcc_base_context *self, - const char *filename, - int /* bool */ verbose); + int /* bool */ (*compile_v0) (struct gcc_base_context *self, + const char *filename, + int /* bool */ verbose); /* Destroy this object. */ void (*destroy) (struct gcc_base_context *self); + + /* Set the compiler's command-line options for the next compilation. + The arguments are copied by GCC. ARGV need not be + NULL-terminated. The arguments must be set separately for each + compilation; that is, after a compile is requested, the + previously-set arguments cannot be reused. + + This returns NULL on success. On failure, returns a malloc()d + error message. The caller is responsible for freeing it. + + This method is only available since GCC_FE_VERSION_1. */ + + char *(*set_arguments) (struct gcc_base_context *self, + int argc, char **argv); + + /* Set TRIPLET_REGEXP as a regular expression that is used to match + the configury triplet prefix to the compiler. Calling this method + overrides possible previous call of itself or set_driver_filename. + + This returns NULL on success. On failure, returns a malloc()d + error message. The caller is responsible for freeing it. + + This method is only available since GCC_FE_VERSION_1. */ + + char *(*set_triplet_regexp) (struct gcc_base_context *self, + const char *triplet_regexp); + + /* DRIVER_FILENAME should be filename of the gcc compiler driver + program. It will be searched in PATH components like + TRIPLET_REGEXP. Calling this method overrides possible previous + call of itself or set_triplet_regexp. + + This returns NULL on success. On failure, returns a malloc()d + error message. The caller is responsible for freeing it. + + This method is only available since GCC_FE_VERSION_1. */ + + char *(*set_driver_filename) (struct gcc_base_context *self, + const char *driver_filename); + + /* VERBOSE can be set to non-zero to cause GCC to print some + information as it works. Calling this method overrides its + possible previous calls. + + This method is only available since GCC_FE_VERSION_1. */ + + void (*set_verbose) (struct gcc_base_context *self, + int /* bool */ verbose); + + /* Perform the compilation. FILENAME is the name of the resulting + object file. Either set_triplet_regexp or set_driver_filename must + be called before. Returns true on success, false on error. + + This method is only available since GCC_FE_VERSION_1. */ + + int /* bool */ (*compile) (struct gcc_base_context *self, + const char *filename); }; /* The GCC object. */ --17pEHd4RhPHOinZp--