public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom de Vries <vries@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] [gdb/testsuite] Fix find_core_file for core named core
Date: Tue,  8 Nov 2022 15:28:16 +0000 (GMT)	[thread overview]
Message-ID: <20221108152817.3AA0A3858D3C@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e406987c476ebb229d04cd606bae2215386b189c

commit e406987c476ebb229d04cd606bae2215386b189c
Author: Tom de Vries <tdevries@suse.de>
Date:   Tue Nov 8 16:28:11 2022 +0100

    [gdb/testsuite] Fix find_core_file for core named core
    
    With test-case gdb.base/bigcore.exp I run into:
    ...
    (gdb) PASS: gdb.base/bigcore.exp: get inferior pid
    signal SIGABRT^M
    Continuing with signal SIGABRT.^M
    ^M
    Program terminated with signal SIGABRT, Aborted.^M
    The program no longer exists.^M
    (gdb) PASS: gdb.base/bigcore.exp: signal SIGABRT
    UNTESTED: gdb.base/bigcore.exp: can't generate a core file
    ...
    due to find_core_file returning "".
    
    There is a core file name core:
    ...
    $ ls ./outputs/gdb.base/bigcore
    bigcore  bigcore.corefile  core  gdb.cmd.1  gdb.in.1  gdbserver.cmd.1
    ...
    but it's not found.
    
    The problem is this statement:
    ...
        lappend files [list ${::testfile}.core core]
    ...
    which adds a single list item "${::testfile}.core core".
    
    Fix this in the most readable way:
    ...
        lappend files ${::testfile}.core
        lappend files core
    ...
    
    Tested on x86_64-linux.

Diff:
---
 gdb/testsuite/lib/gdb.exp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index e2cda30b95a..3e0a46445ca 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -7736,7 +7736,8 @@ proc find_core_file {pid} {
     } elseif {$pid != -1} {
 	lappend files core.$pid
     }
-    lappend files [list ${::testfile}.core core]
+    lappend files ${::testfile}.core
+    lappend files core
 
     foreach file $files {
 	if {![is_remote host]} {

                 reply	other threads:[~2022-11-08 15:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20221108152817.3AA0A3858D3C@sourceware.org \
    --to=vries@sourceware.org \
    --cc=gdb-cvs@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).