From patchwork Mon Sep 23 14:51:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 34636 Received: (qmail 34142 invoked by alias); 23 Sep 2019 14:52:07 -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 34045 invoked by uid 89); 23 Sep 2019 14:52:07 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-wr1-f65.google.com Received: from mail-wr1-f65.google.com (HELO mail-wr1-f65.google.com) (209.85.221.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Sep 2019 14:51:57 +0000 Received: by mail-wr1-f65.google.com with SMTP id r3so14319883wrj.6 for ; Mon, 23 Sep 2019 07:51:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=JCYMcmvjut02F9YebI+seHmKX/PxHLMZKG5WkQZASx4=; b=WLj+uXY6i9x+9qyvf9tVk6zS6LzRQ1YJSwXOvwiuBQn6PKab+h+EtfHG3OVQxzVHx/ hc3U3hVozlvpeAVOX933Zc6hKhV8zkIMQtwjOBNfFmEHvaatZMaQWfgRXc+R+Hbbxe+x IsnOuMBh4LKV4H9gKdMTd98wL+up53OOKYSMsWgBFKRPF0u/A1uMp+3idIPARIb2wyJb HUbXBrKn++2VuomCInoKVZIQgIgi/E4EZ6ujeViqfw4bSRAIKPkIzQL8vMrf+iaz9+nN /dkqYEahqCGFiIxsY3LWp6IzEA30VC6YsE9MCL9ePWt6qVStqkN3k61zYSILfW2eV+En 5IIA== Return-Path: Received: from localhost (host86-128-12-122.range86-128.btcentralplus.com. [86.128.12.122]) by smtp.gmail.com with ESMTPSA id b184sm18253670wmg.47.2019.09.23.07.51.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Sep 2019 07:51:54 -0700 (PDT) Date: Mon, 23 Sep 2019 15:51:53 +0100 From: Andrew Burgess To: Tom Tromey Cc: gdb-patches@sourceware.org, Pedro Alves Subject: Re: [PATCH v2 6/8] Make print-file-var.exp test attribute visibility hidden, dlopen, and main symbol Message-ID: <20190923145153.GI4962@embecosm.com> References: <20190920192017.15293-1-tromey@adacore.com> <20190920192017.15293-7-tromey@adacore.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190920192017.15293-7-tromey@adacore.com> X-Fortune: monitor VLF leakage X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes * Tom Tromey [2019-09-20 13:20:15 -0600]: > From: Pedro Alves > > Make gdb.base/print-file-var.exp test all combinations of: > > - attribute hidden in the this_version_id symbols or not > - dlopen or not > - this_version_id symbol in main file or not > - C++ > > gdb/testsuite/ChangeLog > 2019-08-27 Pedro Alves > Andrew Burgess > > * gdb.base/print-file-var-lib1.c: Include and > "print-file-var.h". > (this_version_id) Use ATTRIBUTE_VISIBILITY. > (get_version_1): Print this_version_id and its address. > Add extern "C" wrappers around interface functions. > * gdb.base/print-file-var-lib2.c: Include and > "print-file-var.h". > (this_version_id) Use ATTRIBUTE_VISIBILITY. > (get_version_2): Print this_version_id and its address. > Add extern "C" wrappers around interface functions. > * gdb.base/print-file-var-main.c: Include , , > and "print-file-var.h". > Add extern "C" wrappers around interface functions. > [VERSION_ID_MAIN] (this_version_id): Define. > (main): Define v0. Use dlopen if SHLIB_NAME is defined. > * gdb.base/print-file-var.h: Add some #defines to simplify setting > up extern "C" blocks. > * gdb.base/print-file-var.exp (test): New, factored out from top > level. > (top level): Test all combinations of attribute hidden or not, > dlopen or not, and this_version_id symbol in main file or not. > Compile tests as both C++ and C, make test names unique. The C++ build of this test should be optional, the following patch applied on top of this one fixes this issue. Thanks, Andrew diff --git a/gdb/testsuite/gdb.base/print-file-var.exp b/gdb/testsuite/gdb.base/print-file-var.exp index 1a065cf568b..9669f99202c 100644 --- a/gdb/testsuite/gdb.base/print-file-var.exp +++ b/gdb/testsuite/gdb.base/print-file-var.exp @@ -24,6 +24,16 @@ proc test {hidden dlopen version_id_main lang} { set suffix "-hidden$hidden-dlopen$dlopen-version_id_main$version_id_main" + # Normally we place different builds (C/C++) of a test into + # subdirectories within the test build directory, however, using + # gdb_load_shlib doesn't work well with this approach, so instead + # add a language specific suffix to the binary and library names. + if { $lang == "c" } { + set suffix "${suffix}_c" + } else { + set suffix "${suffix}_cpp" + } + set executable $main$suffix set lib1 "print-file-var-lib1" @@ -127,7 +137,14 @@ proc test {hidden dlopen version_id_main lang} { compare "'print-file-var-lib2.c'::this_version_id" "v2" } -foreach_with_prefix lang { c c++ } { +# Only test C++ if we are able. Always use C. +if { [skip_cplus_tests] || [get_compiler_info "c++"] } { + set lang_list {c} +} else { + set lang_list {c c++} +} + +foreach_with_prefix lang $lang_list { foreach_with_prefix hidden {0 1} { foreach_with_prefix dlopen {0 1} { foreach_with_prefix version_id_main {0 1} {