This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch, testsuite] Run argv0-symlink.exp only on native target and local host.
- From: Sandra Loosemore <sandra at codesourcery dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Sat, 17 Aug 2019 15:28:56 -0600
- Subject: [patch, testsuite] Run argv0-symlink.exp only on native target and local host.
- Ironport-sdr: 7FcCJHkkL8FxF7szvyIrmChC9LeX/hpOzKn+lVCXe5d2cSU9G7S9VjUs+L0sf5qGwf/MZOtOxw W7SgZVFSECFhUBwiefkHgSrFT+WzfXm0XKY6kWHgfd4hdXa7XC9Bj3k7wRBfhb6BSkXuFc3lj2 THCczyw4ac1MpaVQ5t3tws8SFa/9mISb2coHiwH01CSHCaxPNI1HGRG6vM9+JTS6kDAAZz8sfv XEEvsIefPQwzHAGyQKc49wsMoyyPjc0a09oWFRV9LvKfUb+24ma7Nu6jGXKbDqE5M5MCJMSuf2 fGA=
- Ironport-sdr: 33PUzGD4tCrP/ABdB1axePaX5EvTZ8oV7A+sOGxgW6PLKViYUkm2ovPEGyuU9ahDDJyTFz2kPL /Il9Iv5TU1MgxHp6IdG5Rt+eyyj46C+2arHp4N+hQvl21PzGyueLenxYtTNbL2UM+lpuKkoLWX pMzLeLZCTN+uOySeGOXqHB+Aoys/GF0RJiPqx6jI4rtMM5zr9gw00FBOsO+YOUO/aRR75iGdwK oK48t83EeBH5H1aWD/tcQ9zC3lu4lqccgSnuQi+4YVp0qS3xwb4gMPlvYRIalnw8ay21Yr1guC xdk=
I've been continuing to look into bogus test failures seen on remote
Windows host, and it turns out gdb.base/argv0-symlink.exp is somewhat
more broken than that.
This testcase was originally added for gdb/15415, a problem with the
"run" command expanding symlinks in the name of the program being run.
This test incorrectly uses pathnames on build to create symbolic links
on host:
set status [remote_exec host "ln -sf ${testfile} [standard_output_file
$filelink]"]
and expects the test program running on target to see those symbolic links:
gdb_test {print argv[0]} "/$filelink\"" $test
I see there have been some attempts over the years to try to make this
testcase not fail on bare-metal or gdbserver targets but nothing has
really fixed the build/host/target filesystem confusion. It's probably
possible to do that somehow, but given that this was for a bug in the
"run" command I'm not sure what the value is of attempting to run the
test on targets that don't use "run". (It wasn't a target-specific bug
and GDB surely gets plenty of testing on targets that do use "run".) So
this patch just disables it on targets that are going to trip over the
remote-host or remote-target problems unless there is something magic
going on in the test environment (like, say, a shared network filesystem).
So, is this patch OK, or do we need to try harder to fix the testcase?
-Sandra
commit 145663b08d5a6610e5a90b807ce44ff2d41916d3
Author: Sandra Loosemore <sandra@codesourcery.com>
Date: Sat Aug 17 13:44:17 2019 -0700
Run argv0-symlink.exp only on native target and local host.
This testcase was originally for PR gdb/15415, a problem with the
"run" command expanding symlinks in the name of the program being run.
It does not correctly distinguish between files on build, host, and target,
and it is not clear if it would be testing anything useful in configurations
where "run" is not being used.
2019-08-17 Sandra Loosemore <sandra@codesourcery.com>
gdb/testsuite/
* gdb.base/argv0-symlink.exp: Run only on native target
and local host.
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index edf7d17..b41d879 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-08-17 Sandra Loosemore <sandra@codesourcery.com>
+
+ * gdb.base/argv0-symlink.exp: Run only on native target
+ and local host.
+
2019-08-16 Tom de Vries <tdevries@suse.de>
* gdb.base/compare-sections.exp ("after run to main"): Allow
diff --git a/gdb/testsuite/gdb.base/argv0-symlink.exp b/gdb/testsuite/gdb.base/argv0-symlink.exp
index cce6ca6..33301bd 100644
--- a/gdb/testsuite/gdb.base/argv0-symlink.exp
+++ b/gdb/testsuite/gdb.base/argv0-symlink.exp
@@ -13,6 +13,23 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# This testcase was originally for PR gdb/15415, a problem with the "run"
+# command expanding symlinks in the name of the program being run.
+# This test uses pathnames on build to create symbolic links on host and
+# expects the test program running on target to see those symbolic links.
+# Therefore, it can't work reliably on anything other than configurations
+# where build/host/target are all the same.
+
+if { ![isnative] } {
+ unsupported "argv0-symlink.exp not supported on non-native target"
+ return -1
+}
+
+if { [is_remote host] } {
+ unsupported "argv0-symlink.exp not supported on remote host"
+ return -1
+}
+
standard_testfile
set has_argv0 [gdb_has_argv0]