From: Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Fix gdb.dwarf2/gdb-add-index-symlink.exp
Date: Mon, 11 Oct 2021 12:28:59 +0200 [thread overview]
Message-ID: <20211011102854.GA21618@delia.home> (raw)
Hi,
The test-case gdb.dwarf2/gdb-add-index-symlink.exp interpretes a failure to
add an index as a failure to add an index for a symlink:
...
if { [ensure_gdb_index $symlink] == -1 } {
fail "Unable to call gdb-add-index with a symlink to a symfile"
return -1
}
...
However, it's possible that the gdb-add-index also fails with a regular
file. Add a check for that situation.
Tested on x86_64-linux.
Committed to trunk.
Thanks,
- Tom
[gdb/testsuite] Fix gdb.dwarf2/gdb-add-index-symlink.exp
---
gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
index eaeddec0250..74c558ad231 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
@@ -22,6 +22,19 @@ if {![dwarf2_support]} {
standard_testfile main.c
+# First check whether we can actually handle the non-symlink case.
+with_test_prefix non-symlink {
+ if { [prepare_for_testing "failed to prepare" "${testfile}" \
+ [list ${srcfile}]] } {
+ return -1
+ }
+
+ if { [ensure_gdb_index $binfile] == -1 } {
+ return -1
+ }
+}
+
+# Regenerate exec without index.
if { [prepare_for_testing "failed to prepare" "${testfile}" \
[list ${srcfile}]] } {
return -1
reply other threads:[~2021-10-11 10:29 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=20211011102854.GA21618@delia.home \
--to=gdb-patches@sourceware.org \
--cc=tdevries@suse.de \
/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