From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61668 invoked by alias); 6 Jul 2016 14:07:00 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 61620 invoked by uid 89); 6 Jul 2016 14:06:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=4.8 required=5.0 tests=BAYES_50,BODY_8BITS,GARBLED_BODY,SPF_PASS autolearn=no version=3.3.2 spammy=formatted_ref, adb, UD:ali, base_file 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; Wed, 06 Jul 2016 14:06:49 +0000 Received: from EUSAAHC007.ericsson.se (Unknown_Domain [147.117.188.93]) by usplmg20.ericsson.net (Symantec Mail Security) with SMTP id 64.85.09012.7D50D775; Wed, 6 Jul 2016 15:21:27 +0200 (CEST) Received: from [142.133.110.144] (147.117.188.8) by smtp-am.internal.ericsson.com (147.117.188.95) with Microsoft SMTP Server id 14.3.294.0; Wed, 6 Jul 2016 10:06:46 -0400 Subject: Re: [PATCH] Remove extra output directory level for Ada tests To: References: <20160705143928.12314-1-simon.marchi@ericsson.com> CC: Joel Brobecker From: Simon Marchi Message-ID: <577D1076.2050000@ericsson.com> Date: Wed, 06 Jul 2016 14:07:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <20160705143928.12314-1-simon.marchi@ericsson.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-07/txt/msg00099.txt.bz2 On 16-07-05 10:39 AM, Simon Marchi wrote: > The output of Ada tests create a layout where the test name > ("formatted_ref" in this example) appears twice: >=20 > outputs > =E2=94=94=E2=94=80=E2=94=80 gdb.ada > =E2=94=94=E2=94=80=E2=94=80 formatted_ref > =E2=94=94=E2=94=80=E2=94=80 formatted_ref > =E2=94=9C=E2=94=80=E2=94=80 b~formatted_ref.adb > =E2=94=9C=E2=94=80=E2=94=80 b~formatted_ref.ads > =E2=94=9C=E2=94=80=E2=94=80 b~formatted_ref.ali > =E2=94=9C=E2=94=80=E2=94=80 b~formatted_ref.o > =E2=94=9C=E2=94=80=E2=94=80 defs.ali > =E2=94=9C=E2=94=80=E2=94=80 defs.o > =E2=94=9C=E2=94=80=E2=94=80 formatted_ref > =E2=94=9C=E2=94=80=E2=94=80 formatted_ref.ali > =E2=94=94=E2=94=80=E2=94=80 formatted_ref.o >=20 > This causes a problem when testing with the native-gdbserver board, when > the binary has the same name as the test. When gdb_remote_download is > called to upload the compiled binary, the implementation for > native-gdbserver copies it in the standard output directory (in > outputs/gdb.ada/formatted_ref). However, there is already a directory > named formatted_ref in there, so the copy fails and gdbserver isn't able > to load the binary. >=20 > This patch bypasses the problem by removing the extra directory level. > The compiled binary will already be in its final location in the > standard output directory, so the copy will effectively be a no-op. >=20 > gdb/testsuite/ChangeLog: >=20 > * lib/ada.exp: Remove extra directory level in build directory. > * gdb.ada/cond_lang.exp: Likewise. > * gdb.ada/exec_changed.exp: Likewise. > * gdb.ada/lang_switch.exp: Likewise. > --- > gdb/testsuite/gdb.ada/cond_lang.exp | 4 ++-- > gdb/testsuite/gdb.ada/exec_changed.exp | 7 +++---- > gdb/testsuite/gdb.ada/lang_switch.exp | 4 ++-- > gdb/testsuite/lib/ada.exp | 7 +++---- > 4 files changed, 10 insertions(+), 12 deletions(-) >=20 > diff --git a/gdb/testsuite/gdb.ada/cond_lang.exp b/gdb/testsuite/gdb.ada/= cond_lang.exp > index e08fada..997b37a 100644 > --- a/gdb/testsuite/gdb.ada/cond_lang.exp > +++ b/gdb/testsuite/gdb.ada/cond_lang.exp > @@ -17,8 +17,8 @@ load_lib "ada.exp" >=20=20 > standard_ada_testfile a >=20=20 > -set cfile "${testdir}/foo" > -set csrcfile ${srcdir}/${subdir}/${cfile}.c > +set cfile "foo" > +set csrcfile ${srcdir}/${subdir}/${testdir}/${cfile}.c > set cobject [standard_output_file ${cfile}.o] >=20=20 > gdb_compile "${csrcfile}" "${cobject}" object [list debug] > diff --git a/gdb/testsuite/gdb.ada/exec_changed.exp b/gdb/testsuite/gdb.a= da/exec_changed.exp > index 6cc6408..a574cd5 100644 > --- a/gdb/testsuite/gdb.ada/exec_changed.exp > +++ b/gdb/testsuite/gdb.ada/exec_changed.exp > @@ -32,9 +32,8 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}$EXEEXT" e= xecutable {debug}] !=3D ""} > } >=20=20 > # Build the second test program > -set testfile2 "${testdir}/second" > -set srcfile2 ${srcdir}/${subdir}/${testfile2}.adb > -set binfile2 [standard_output_file ${testfile2}$EXEEXT] > +set srcfile2 ${srcdir}/${subdir}/${testdir}/second.adb > +set binfile2 [standard_output_file second$EXEEXT] >=20=20 > if {[gdb_compile_ada "${srcfile2}" "${binfile2}" executable {debug}] != =3D ""} { > return -1 > @@ -42,7 +41,7 @@ if {[gdb_compile_ada "${srcfile2}" "${binfile2}" execut= able {debug}] !=3D ""} { >=20=20 > # Start with a fresh gdb. >=20=20 > -set common_binfile [standard_output_file ${testdir}/common$EXEEXT] > +set common_binfile [standard_output_file common$EXEEXT] >=20=20 > gdb_start > gdb_reinitialize_dir $srcdir/$subdir > diff --git a/gdb/testsuite/gdb.ada/lang_switch.exp b/gdb/testsuite/gdb.ad= a/lang_switch.exp > index 8045358..661829b 100644 > --- a/gdb/testsuite/gdb.ada/lang_switch.exp > +++ b/gdb/testsuite/gdb.ada/lang_switch.exp > @@ -16,8 +16,8 @@ > load_lib "ada.exp" >=20=20 > standard_ada_testfile lang_switch > -set cfile "${testdir}/foo" > -set csrcfile ${srcdir}/${subdir}/${cfile}.c > +set cfile "foo" > +set csrcfile ${srcdir}/${subdir}/${testdir}/${cfile}.c > set cobject [standard_output_file ${cfile}.o] >=20=20 > gdb_compile "${csrcfile}" "${cobject}" object [list debug] > diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp > index 01f3008..a9d1758 100644 > --- a/gdb/testsuite/lib/ada.exp > +++ b/gdb/testsuite/lib/ada.exp > @@ -73,9 +73,8 @@ proc standard_ada_testfile {base_file {dir ""}} { > } else { > set testdir $dir > } > - set testfile $testdir/$base_file > - set srcfile $srcdir/$subdir/$testfile.adb > - set binfile [standard_output_file $testfile] >=20=20 > - file mkdir [standard_output_file $testdir] > + set testfile $base_file > + set srcfile $srcdir/$subdir/$testdir/$testfile.adb > + set binfile [standard_output_file $testfile] > } >=20 Pushed (approved by Joel in [1]). [1] https://sourceware.org/ml/gdb-patches/2016-07/msg00098.html