From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by sourceware.org (Postfix) with ESMTPS id 5D3DF385DC27 for ; Tue, 31 Mar 2020 17:12:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5D3DF385DC27 IronPort-SDR: DCWnPHGlDkwb70QE+uyJo4cddNLw4bWazyKK2+6HBEO38ux6UCQS8X4u0PXiTEc68EjAgzm5Fv mxmWB9BjMrkw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2020 10:12:38 -0700 IronPort-SDR: 9CJdLAZKW8BDRSzPYtzVAB7tg/lpT7sk+N9rqwbDj/MCtqKs+99wrgW2VxOKvciBSf6HhCaC+L JpCkMF2nzUhA== X-IronPort-AV: E=Sophos;i="5.72,328,1580803200"; d="scan'208";a="241971504" Received: from labpc7920x-08.iul.intel.com (HELO localhost) ([172.28.49.151]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2020 10:12:37 -0700 From: Mihails Strasuns To: gdb-patches@sourceware.org Subject: [PATCH v3 9/9] [gdb/testsuite] handle compilation failures in jit-elf-helpers Date: Tue, 31 Mar 2020 19:13:56 +0200 Message-Id: <20200331171356.26126-9-mihails.strasuns@intel.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200331171356.26126-1-mihails.strasuns@intel.com> References: <166773> <20200331171356.26126-1-mihails.strasuns@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-25.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2020 17:12:40 -0000 Enhances lib/jit-elf-helpers.exp and tests using it to return failure status code and exit tests early if necessary binaries fail to compile. gdb/testsuite/ChangeLog: 2020-03-31 Mihails Strasuns * gdb.base/jit-elf-so.exp: exit early on compilation failures * gdb.base/jit-elf.exp: exit early on compilation failures * lib/jit-elf-helpers.exp: report compilation failures Signed-off-by: Mihails Strasuns Change-Id: I3c773a4e7d8e23a92b3e7613c6db67254ec33c08 --- gdb/testsuite/gdb.base/jit-elf-so.exp | 15 +++++++++++++-- gdb/testsuite/gdb.base/jit-elf.exp | 9 ++++++++- gdb/testsuite/lib/jit-elf-helpers.exp | 3 +++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.base/jit-elf-so.exp b/gdb/testsuite/gdb.base/jit-elf-so.exp index 55154e9866..206f8aa2b3 100644 --- a/gdb/testsuite/gdb.base/jit-elf-so.exp +++ b/gdb/testsuite/gdb.base/jit-elf-so.exp @@ -29,8 +29,15 @@ if {[get_compiler_info]} { load_lib jit-elf-helpers.exp global testfile srcfile binfile solib_binfile_targets -lassign [compile_jit_main_as_so] testfile srcfile binfile +set jit_main [compile_jit_main_as_so] +if {![llength $jit_main]} { + return -1 +} +lassign $jit_main testfile srcfile binfile set solib_binfile_targets [compile_n_jit_so 2] +if {![llength $solib_binfile_targets]} { + return -1 +} # Compile the test case shared library loader. proc compile_jit_dlmain {} { @@ -41,10 +48,14 @@ proc compile_jit_dlmain {} { if { [gdb_compile "${srcdir}/${subdir}/${srcfile_dlmain}" "${binfile}" \ executable {debug shlib_load}] != "" } { untested "Failure to compile jit-elf-main" + return -1 } + return 0 } -compile_jit_dlmain +if {[compile_jit_dlmain]} { + return -1 +} proc one_jit_test {count match_str} { with_test_prefix "one_jit_test-$count" { diff --git a/gdb/testsuite/gdb.base/jit-elf.exp b/gdb/testsuite/gdb.base/jit-elf.exp index bf0e253bb9..e731e8be66 100644 --- a/gdb/testsuite/gdb.base/jit-elf.exp +++ b/gdb/testsuite/gdb.base/jit-elf.exp @@ -27,6 +27,9 @@ load_lib jit-elf-helpers.exp global testfile srcfile binfile solib_binfile_targets set solib_binfile_targets [compile_n_jit_so 2] +if {![llength $solib_binfile_targets]} { + return -1 +} # Detach, restart GDB, and re-attach to the program. @@ -117,7 +120,11 @@ proc one_jit_test {count match_str reattach} { } } -lassign [compile_jit_main "" {}] testfile srcfile binfile +set jit_main [compile_jit_main "" {}] +if {![llength $jit_main]} { + return -1 +} +lassign $jit_main testfile srcfile binfile one_jit_test 1 "${hex} jit_function_0001" 0 one_jit_test 2 "${hex} jit_function_0001\[\r\n\]+${hex} jit_function_0002" 0 diff --git a/gdb/testsuite/lib/jit-elf-helpers.exp b/gdb/testsuite/lib/jit-elf-helpers.exp index 8a7a1796cc..833c0541c6 100644 --- a/gdb/testsuite/lib/jit-elf-helpers.exp +++ b/gdb/testsuite/lib/jit-elf-helpers.exp @@ -39,6 +39,7 @@ proc compile_jit_main {binsuffix options} { if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ executable $options] != "" } { untested "Failure to compile jit-elf-main" + return {} } return [list $testfile $srcfile $binfile] } @@ -58,6 +59,7 @@ proc compile_jit_main_as_so {} { if { [gdb_compile_shlib "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ $options] != "" } { untested "Failure to compile jit-elf-main" + return {} } return [list $testfile $srcfile $binfile] } @@ -87,6 +89,7 @@ proc compile_n_jit_so {count} { additional_flags=-Ttext-segment=$addr] if { [gdb_compile_shlib $solib_srcfile $solib_binfile $options] != "" } { untested "Failure to compile $solib_binfile_test_msg" + return {} } set path [gdb_remote_download target $solib_binfile] -- 2.25.2 Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Gary Kershaw Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928