From patchwork Thu Dec 17 22:38:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 10060 Received: (qmail 94262 invoked by alias); 17 Dec 2015 22:38:37 -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 94251 invoked by uid 89); 17 Dec 2015 22:38:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 spammy=shlib, FLAG, dlopen X-HELO: usplmg20.ericsson.net Received: from usplmg20.ericsson.net (HELO usplmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 17 Dec 2015 22:38:35 +0000 Received: from EUSAAHC006.ericsson.se (Unknown_Domain [147.117.188.90]) by usplmg20.ericsson.net (Symantec Mail Security) with SMTP id 5B.A9.06940.F8833765; Thu, 17 Dec 2015 23:34:56 +0100 (CET) Received: from elxcz23q12-y4.dyn.mo.ca.am.ericsson.se (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.90) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 17 Dec 2015 17:38:32 -0500 From: Simon Marchi To: CC: Simon Marchi Subject: [PATCH] Add documentation to gdb_compile Date: Thu, 17 Dec 2015 17:38:23 -0500 Message-ID: <1450391903-767-1-git-send-email-simon.marchi@ericsson.com> MIME-Version: 1.0 X-IsSubscribed: yes This patch adds some documentation to gdb_compile. It describes the various options that can influence compilation. Most of them are handled by DejaGnu, but are not really documented anywhere, so I think it's good to have a quick reference. Not all possible options are described, that would add way to much noise. I chose those that I think are relevant in the context of writing a test case. gdb/testsuite/ChangeLog: * lib/gdb.exp (gdb_compile): Add function doc. --- gdb/testsuite/lib/gdb.exp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index beb97ea..e426ade 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -3297,6 +3297,40 @@ proc gdb_wrapper_init { args } { global gdb_saved_set_unbuffered_mode_obj set gdb_saved_set_unbuffered_mode_obj "" +# Compile source files specified by SOURCE into a binary of type TYPE at path +# DEST. gdb_compile is implemented using DejaGnu's target_compile, so the type +# parameter and most options are passed directly to it. +# +# The type can be one of the following: +# +# - object: Compile into an object file. +# - executable: Compile and link into an executable. +# - preprocess: Preprocess the source files. +# - assembly: Generate assembly listing. +# +# The following options are understood and processed by gdb_compile: +# +# - shlib=so_path: Add SO_PATH to the sources, and enable some target-specific +# quirks to be able to use shared libraries. +# - shlib_load: Link with appropriate libraries to allow the test to +# dynamically load libraries at runtime. For example, on Linux, this adds +# -ldl so that the test can use dlopen. +# - nowarnings: Inhibit all compiler warnings. +# +# And here are some of the not too obscure options understood by DejaGnu that +# influence the compilation: +# +# - additional_flags=flag: Add FLAG to the compiler flags. +# - libs=library: Add LIBRARY to the libraries passed to the linker. The +# argument can be a file, in which case it's added to the sources, or a +# linker flag. +# - ldflags=flag: Add FLAG to the linker flags. +# - incdir=path: Add PATH to the searched include directories. +# - libdir=path: Add PATH to the linker searched directories. +# - ada, c++, f77: Compile the file as Ada, C++ or Fortran. +# - debug: Build with debug information. +# - optimize: Build with optimization + proc gdb_compile {source dest type options} { global GDB_TESTCASE_OPTIONS global gdb_wrapper_file