aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/py-section-script.exp
diff options
context:
space:
mode:
authorSandra Loosemore <sandra@codesourcery.com>2019-08-13 09:09:30 -0700
committerSandra Loosemore <sandra@codesourcery.com>2019-08-13 09:09:30 -0700
commit74c2c1f45f036c4f155cc65a86022ce6eef0c5c5 (patch)
treeaa06d8d9e32f2c08a224674e97e39a9875002fcd /gdb/testsuite/gdb.python/py-section-script.exp
parent5067f530c3a26330263649fbef23c7685f27cbb7 (diff)
downloadbinutils-74c2c1f45f036c4f155cc65a86022ce6eef0c5c5.zip
binutils-74c2c1f45f036c4f155cc65a86022ce6eef0c5c5.tar.gz
binutils-74c2c1f45f036c4f155cc65a86022ce6eef0c5c5.tar.bz2
Fixes for gdb.python tests on remote Windows host.
This patch fixes several test ERRORs and FAILs seen from running gdb.python tests on a remote Windows host. The problems fixed generally fall into these categories: - Failure to copy the .py script to the host. - Confusion between build and host pathnames. - Assuming pathnames printed on the host include "/" as a directory separator. - Tests that need to be conditionally disabled due to missing features on the host, etc. 2019-08-13 Sandra Loosemore <sandra@codesourcery.com> gdb/testsuite/ * gdb.python/py-completion.exp: Download the .py file to the host and use its host pathname. Conditionalize tests that use tab completion and manipulate files on the build machine. * gdb.python/py-events.exp: Download the .py file to the host and use its host pathname. * gdb.python/py-evsignal.exp: Likewise. * gdb.python/py-evthreads.exp: Likewise. * gdb.python/py-framefilter-invalidarg.exp: Match Windows pathname syntax. * gdb.python/py-framefilter.exp: Download the .py file to the right place on the host. Match Windows pathname syntax. * gdb.python/py-mi-var-info-path-expression.exp: Download the .py file to the host and use its host pathname. * gdb.python/py-objfile-script.exp: Match Windows pathname syntax. * gdb.python/py-objfile.exp: Expect a host pathname, not a build pathname. Skip symlink test on Windows host. Add missing newline at end of file. * gdb.python/py-pp-maint.exp: Download the .py file to the host and use its host pathname. * gdb.python/py-pp-registration.exp: Match Windows pathname syntax. * gdb.python/py-section-script.exp: Use host location of binfile on safe-path. Use correct path separator on Windows host. Reorder alternatives in gdb_test_multiple to prevent matching the wrong alternative on success. * gdb.python/py-symtab.exp: Match Windows pathname syntax.
Diffstat (limited to 'gdb/testsuite/gdb.python/py-section-script.exp')
-rw-r--r--gdb/testsuite/gdb.python/py-section-script.exp21
1 files changed, 17 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.python/py-section-script.exp b/gdb/testsuite/gdb.python/py-section-script.exp
index c4a6974..9eaa791 100644
--- a/gdb/testsuite/gdb.python/py-section-script.exp
+++ b/gdb/testsuite/gdb.python/py-section-script.exp
@@ -77,22 +77,35 @@ gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
-gdb_test_no_output "set auto-load safe-path ${remote_python_file}:${binfile}" \
+# Get the name of the binfile on the host; on a remote host this means
+# stripping off any directory prefix.
+if [is_remote host] {
+ set remote_binfile [file tail ${binfile}]
+} else {
+ set remote_binfile ${binfile}
+}
+
+if [ishost *-*-mingw*] {
+ set remote_pathsep ";"
+} else {
+ set remote_pathsep ":"
+}
+gdb_test_no_output "set auto-load safe-path ${remote_python_file}${remote_pathsep}${remote_binfile}" \
"set auto-load safe-path"
gdb_load ${binfile}
# Verify gdb loaded each script and they appear once in the list.
set test_name "verify scripts loaded"
gdb_test_multiple "info auto-load python-scripts" "$test_name" {
+ -re "Yes.*${testfile}.py.*Yes.*inlined-script.*$gdb_prompt $" {
+ pass "$test_name"
+ }
-re "${testfile}.py.*${testfile}.py.*$gdb_prompt $" {
fail "$test_name"
}
-re "inlined-script.*inlined-script.*$gdb_prompt $" {
fail "$test_name"
}
- -re "Yes.*${testfile}.py.*Yes.*inlined-script.*$gdb_prompt $" {
- pass "$test_name"
- }
}
# Again, with a regexp this time.