Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Cc: Pierre Muller <muller@sourceware.org>, Keith Seitz <keiths@redhat.com>
Subject: [PATCH][gdb/testsuite] Clean up stale exec in gdb_compile_pascal
Date: Fri, 16 Aug 2019 16:26:00 -0000	[thread overview]
Message-ID: <20190816162618.GA19652@delia> (raw)

Hi,

When running a pascal test with the stabs target board:
...
$ test=gdb.pascal/case-insensitive-symbols.exp
$ cd build/gdb/testsuite
$ make check RUNTESTFLAGS="$test --target_board=stabs"
...
we get:
...
nr of untested testcases         1
nr of unsupported tests          1
...
due to:
...
Error: Illegal parameter: -gstabs+^M
Error: /usr/bin/ppcx64 returned an error exitcode^M
...

OTOH, when running the same pascal test without the stabs target board:
...
$ make check RUNTESTFLAGS="$test"
...
we get:
...
nr of expected passes            20
...

But when subsequently again running with the stabs target board:
...
$ make check RUNTESTFLAGS="$test --target_board=stabs"
...
we now get:
...
nr of expected passes            20
...

The problem is that gdb_compile_pascal determines success based on existence
of the exec after compilation:
...
    if ![file exists $destfile] {
        unsupported "Pascal compilation failed: $result"
        return "Pascal compilation failed."
    }
...
without removing the exec before compilation, which allows a stale exec to
make it seem as if compilation has succeeded.

Fix this by removing the stale exec before compilation.

OK for trunk?

Thanks,
- Tom

[gdb/testsuite] Clean up stale exec in gdb_compile_pascal

gdb/testsuite/ChangeLog:

2019-08-16  Tom de Vries  <tdevries@suse.de>

	* lib/pascal.exp (gdb_compile_pascal): Remove $destfile before
	compilation.

---
 gdb/testsuite/lib/pascal.exp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gdb/testsuite/lib/pascal.exp b/gdb/testsuite/lib/pascal.exp
index 796c2a781e..dcdbb8d1f9 100644
--- a/gdb/testsuite/lib/pascal.exp
+++ b/gdb/testsuite/lib/pascal.exp
@@ -153,6 +153,8 @@ proc gdb_compile_pascal {source destfile type options} {
 	pascal_init
     }
 
+    file delete $destfile
+
     if { $pascal_compiler_is_fpc == 1 } {
         set result [fpc_compile $source $destfile $type $options]
     } elseif { $pascal_compiler_is_gpc == 1 } {


             reply	other threads:[~2019-08-16 16:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-16 16:26 Tom de Vries [this message]
2019-08-20 15:07 ` Tom Tromey

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=20190816162618.GA19652@delia \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@redhat.com \
    --cc=muller@sourceware.org \
    /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