Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: Tom Tromey <tromey@adacore.com>
Cc: gdb-patches@sourceware.org, Pedro Alves <palves@redhat.com>
Subject: Re: [PATCH v2 6/8] Make print-file-var.exp test attribute visibility hidden, dlopen, and main symbol
Date: Mon, 23 Sep 2019 14:52:00 -0000	[thread overview]
Message-ID: <20190923145153.GI4962@embecosm.com> (raw)
In-Reply-To: <20190920192017.15293-7-tromey@adacore.com>

* Tom Tromey <tromey@adacore.com> [2019-09-20 13:20:15 -0600]:

> From: Pedro Alves <palves@redhat.com>
> 
> 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  <palves@redhat.com>
> 	    Andrew Burgess  <andrew.burgess@embecosm.com>
> 
> 	* gdb.base/print-file-var-lib1.c: Include <stdio.h> 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 <stdio.h> 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 <dlfcn.h>, <assert.h>,
> 	<stddef.h> 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} {



  reply	other threads:[~2019-09-23 14:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-20 19:20 [PATCH v2 0/8] Handle copy relocations and add $_ada_exception Tom Tromey
2019-09-20 19:20 ` [PATCH v2 1/8] Change SYMBOL_VALUE_ADDRESS to be an rvalue Tom Tromey
2019-09-20 19:20 ` [PATCH v2 7/8] Back out earlier Ada exception change Tom Tromey
2019-09-20 19:20 ` [PATCH v2 6/8] Make print-file-var.exp test attribute visibility hidden, dlopen, and main symbol Tom Tromey
2019-09-23 14:52   ` Andrew Burgess [this message]
2019-10-01 14:11     ` Tom Tromey
2019-09-20 19:20 ` [PATCH v2 8/8] Add $_ada_exception convenience variable Tom Tromey
2019-09-20 19:20 ` [PATCH v2 3/8] Don't call decode_line_with_current_source from select_source_symtab Tom Tromey
2019-09-20 19:20 ` [PATCH v2 2/8] Search global block from basic_lookup_symbol_nonlocal Tom Tromey
2019-09-21  4:32   ` Christian Biesinger via gdb-patches
2019-09-23 14:17     ` Andrew Burgess
2019-10-02 15:51       ` Tom Tromey
2019-11-09  6:54       ` Christian Biesinger via gdb-patches
2019-09-20 19:27 ` [PATCH v2 5/8] Handle copy relocations Tom Tromey
2019-09-20 19:27 ` [PATCH v2 4/8] Make current_source_* per-program-space Tom Tromey
2019-09-23 14:56 ` [PATCH v2 0/8] Handle copy relocations and add $_ada_exception Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190923145153.GI4962@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=tromey@adacore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox