* [pushed 1/6] [gdb/testsuite] Fix gdb.guile/guile.exp for remote host
@ 2023-03-29 6:01 Tom de Vries
2023-03-29 6:02 ` [pushed 2/6] [gdb/testsuite] Fix gdb.guile/scm-cmd.exp without readline Tom de Vries
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Tom de Vries @ 2023-03-29 6:01 UTC (permalink / raw)
To: gdb-patches
Fix test-case gdb.guile/guile.exp for remote host using gdb_remote_download.
Tested on x86_64-linux.
---
gdb/testsuite/gdb.guile/guile.exp | 38 +++++++++++++++++--------------
1 file changed, 21 insertions(+), 17 deletions(-)
diff --git a/gdb/testsuite/gdb.guile/guile.exp b/gdb/testsuite/gdb.guile/guile.exp
index 4db2f7cd309..7d0c063583d 100644
--- a/gdb/testsuite/gdb.guile/guile.exp
+++ b/gdb/testsuite/gdb.guile/guile.exp
@@ -20,6 +20,8 @@ load_lib gdb-guile.exp
clean_restart
+set host_source2_scm [gdb_remote_download host $srcdir/$subdir/source2.scm]
+
# Do this instead of the skip_guile_check.
# We want to do some tests when Guile is not present.
gdb_test_multiple "guile (display 23) (newline)" "verify guile support" {
@@ -32,7 +34,7 @@ gdb_test_multiple "guile (display 23) (newline)" "verify guile support" {
# If Guile is not supported, verify that sourcing a guile script
# causes an error.
- gdb_test "source $srcdir/$subdir/source2.scm" \
+ gdb_test "source $host_source2_scm" \
"Error in sourced command file:.*" \
"source source2.scm when guile disabled"
@@ -63,7 +65,7 @@ gdb_test_multiline "show guile command" \
"end" "" \
"show user zzq" "User command \"zzq\":.* guile.*\\(print 23\\).* end"
-gdb_test "source $srcdir/$subdir/source2.scm" "yes" "source source2.scm"
+gdb_test "source $host_source2_scm" "yes" "source source2.scm"
gdb_test "source -s source2.scm" "yes"
@@ -81,19 +83,21 @@ gdb_test "guile (print a)" "= .*aliases -- User-defined aliases of other command
"verify help to uiout"
# Verify that we can source a guile script using ~ for the HOME directory.
-save_vars { env(HOME) } {
- # Create a new directory to act as a temporary HOME directory.
- set tmp_home [standard_output_file tmp_home]
- file mkdir $tmp_home
-
- # Copy the file we want to source into the new HOME directory.
- gdb_remote_download host ${srcdir}/${subdir}/source2.scm \
- ${tmp_home}/source2.scm
-
- # Arrange to use the new HOME directory.
- set env(HOME) $tmp_home
- clean_restart
-
- # Finally, source the file out of our new HOME directory.
- gdb_test "source ~/source2.scm" "yes"
+if { ![is_remote host ] } {
+ save_vars { env(HOME) } {
+ # Create a new directory to act as a temporary HOME directory.
+ set tmp_home [standard_output_file tmp_home]
+ file mkdir $tmp_home
+
+ # Copy the file we want to source into the new HOME directory.
+ gdb_remote_download host ${srcdir}/${subdir}/source2.scm \
+ ${tmp_home}/source2.scm
+
+ # Arrange to use the new HOME directory.
+ set env(HOME) $tmp_home
+ clean_restart
+
+ # Finally, source the file out of our new HOME directory.
+ gdb_test "source ~/source2.scm" "yes"
+ }
}
base-commit: aec101ab06697221d2bc2f82b3a65fb92054ed9f
--
2.35.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [pushed 2/6] [gdb/testsuite] Fix gdb.guile/scm-cmd.exp without readline
2023-03-29 6:01 [pushed 1/6] [gdb/testsuite] Fix gdb.guile/guile.exp for remote host Tom de Vries
@ 2023-03-29 6:02 ` Tom de Vries
2023-03-29 6:02 ` [pushed 3/6] [gdb/testsuite] Fix gdb.guile/scm-objfile-script.exp for remote host Tom de Vries
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2023-03-29 6:02 UTC (permalink / raw)
To: gdb-patches
Fix test-case gdb.guile/scm-cmd.exp using readline_is_used.
Tested on x86_64-linux.
---
gdb/testsuite/gdb.guile/scm-cmd.exp | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/gdb/testsuite/gdb.guile/scm-cmd.exp b/gdb/testsuite/gdb.guile/scm-cmd.exp
index a7fb59b0089..25a9780a4d5 100644
--- a/gdb/testsuite/gdb.guile/scm-cmd.exp
+++ b/gdb/testsuite/gdb.guile/scm-cmd.exp
@@ -149,14 +149,17 @@ gdb_test "complete expr-test bar\." \
"expr-test bar\.bc.*expr-test bar\.ij.*" \
"test completion through complete command"
-set test "complete 'expr-test bar.i'"
-send_gdb "expr-test bar\.i\t\t"
-gdb_test_multiple "" "$test" {
- -re "expr-test bar\.ij \\\x07$" {
- send_gdb "\n"
- gdb_test_multiple "" $test {
- -re "invoked on = bar.ij.*$gdb_prompt $" {
- pass "$test"
+
+if { [readline_is_used] } {
+ set test "complete 'expr-test bar.i'"
+ send_gdb "expr-test bar\.i\t\t"
+ gdb_test_multiple "" "$test" {
+ -re "expr-test bar\.ij \\\x07$" {
+ send_gdb "\n"
+ gdb_test_multiple "" $test {
+ -re "invoked on = bar.ij.*$gdb_prompt $" {
+ pass "$test"
+ }
}
}
}
--
2.35.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [pushed 3/6] [gdb/testsuite] Fix gdb.guile/scm-objfile-script.exp for remote host
2023-03-29 6:01 [pushed 1/6] [gdb/testsuite] Fix gdb.guile/guile.exp for remote host Tom de Vries
2023-03-29 6:02 ` [pushed 2/6] [gdb/testsuite] Fix gdb.guile/scm-cmd.exp without readline Tom de Vries
@ 2023-03-29 6:02 ` Tom de Vries
2023-03-29 6:02 ` [pushed 4/6] " Tom de Vries
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2023-03-29 6:02 UTC (permalink / raw)
To: gdb-patches
Fix test-case gdb.guile/scm-objfile-script.exp using host_standard_output_file.
Tested on x86_64-linux.
---
gdb/testsuite/gdb.guile/scm-objfile-script.exp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.guile/scm-objfile-script.exp b/gdb/testsuite/gdb.guile/scm-objfile-script.exp
index 6a935d7926c..dc390b6b9ec 100644
--- a/gdb/testsuite/gdb.guile/scm-objfile-script.exp
+++ b/gdb/testsuite/gdb.guile/scm-objfile-script.exp
@@ -31,7 +31,7 @@ if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
# gdb will find it.
set remote_guile_file [remote_download host \
${srcdir}/${subdir}/${testfile}-gdb.in \
- [standard_output_file ${testfile}-gdb.scm]]
+ [host_standard_output_file ${testfile}-gdb.scm]]
clean_restart
gdb_test_no_output "set auto-load safe-path ${remote_guile_file}" \
--
2.35.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [pushed 4/6] [gdb/testsuite] Fix gdb.guile/scm-objfile-script.exp for remote host
2023-03-29 6:01 [pushed 1/6] [gdb/testsuite] Fix gdb.guile/guile.exp for remote host Tom de Vries
2023-03-29 6:02 ` [pushed 2/6] [gdb/testsuite] Fix gdb.guile/scm-cmd.exp without readline Tom de Vries
2023-03-29 6:02 ` [pushed 3/6] [gdb/testsuite] Fix gdb.guile/scm-objfile-script.exp for remote host Tom de Vries
@ 2023-03-29 6:02 ` Tom de Vries
2023-03-29 6:02 ` [pushed 5/6] [gdb/testsuite] Fix /gdb.guile/scm-parameter.exp " Tom de Vries
2023-03-29 6:02 ` [pushed 6/6] [gdb/testsuite] Fix gdb.guile/scm-symbol.exp " Tom de Vries
4 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2023-03-29 6:02 UTC (permalink / raw)
To: gdb-patches
Fix test-case gdb.guile/scm-objfile-script.exp using gdb_remote_download.
Tested on x86_64-linux.
---
gdb/testsuite/gdb.guile/scm-objfile-script.exp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.guile/scm-objfile-script.exp b/gdb/testsuite/gdb.guile/scm-objfile-script.exp
index dc390b6b9ec..89abc38ed3c 100644
--- a/gdb/testsuite/gdb.guile/scm-objfile-script.exp
+++ b/gdb/testsuite/gdb.guile/scm-objfile-script.exp
@@ -29,9 +29,9 @@ if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
# Make the -gdb.scm script available to gdb, it is automagically loaded by gdb.
# Care is taken to put it in the same directory as the binary so that
# gdb will find it.
-set remote_guile_file [remote_download host \
+set remote_guile_file [gdb_remote_download host \
${srcdir}/${subdir}/${testfile}-gdb.in \
- [host_standard_output_file ${testfile}-gdb.scm]]
+ ${testfile}-gdb.scm]
clean_restart
gdb_test_no_output "set auto-load safe-path ${remote_guile_file}" \
--
2.35.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [pushed 5/6] [gdb/testsuite] Fix /gdb.guile/scm-parameter.exp for remote host
2023-03-29 6:01 [pushed 1/6] [gdb/testsuite] Fix gdb.guile/guile.exp for remote host Tom de Vries
` (2 preceding siblings ...)
2023-03-29 6:02 ` [pushed 4/6] " Tom de Vries
@ 2023-03-29 6:02 ` Tom de Vries
2023-03-29 6:02 ` [pushed 6/6] [gdb/testsuite] Fix gdb.guile/scm-symbol.exp " Tom de Vries
4 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2023-03-29 6:02 UTC (permalink / raw)
To: gdb-patches
Fix test-case gdb.guile/scm-parameter.exp for remote host by taking into
account that gdb_reinitialize_dir has no effect for remote host.
Tested on x86_64-linux.
---
gdb/testsuite/gdb.guile/scm-parameter.exp | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.guile/scm-parameter.exp b/gdb/testsuite/gdb.guile/scm-parameter.exp
index 2e9d9ed9a5d..e2f82a1e738 100644
--- a/gdb/testsuite/gdb.guile/scm-parameter.exp
+++ b/gdb/testsuite/gdb.guile/scm-parameter.exp
@@ -34,8 +34,15 @@ proc scm_param_test_maybe_no_output { command pattern args } {
}
# We use "." here instead of ":" so that this works on win32 too.
-set escaped_directory [string_to_regexp "$srcdir/$subdir"]
-gdb_test "guile (print (parameter-value \"directories\"))" "$escaped_directory.\\\$cdir.\\\$cwd"
+if { [is_remote host] } {
+ # Proc gdb_reinitialize_dir has no effect for remote host.
+ gdb_test "guile (print (parameter-value \"directories\"))" \
+ "\\\$cdir.\\\$cwd"
+} else {
+ set escaped_directory [string_to_regexp "$srcdir/$subdir"]
+ gdb_test "guile (print (parameter-value \"directories\"))" \
+ "$escaped_directory.\\\$cdir.\\\$cwd"
+}
# Test a simple boolean parameter, and parameter? while we're at it.
--
2.35.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [pushed 6/6] [gdb/testsuite] Fix gdb.guile/scm-symbol.exp for remote host
2023-03-29 6:01 [pushed 1/6] [gdb/testsuite] Fix gdb.guile/guile.exp for remote host Tom de Vries
` (3 preceding siblings ...)
2023-03-29 6:02 ` [pushed 5/6] [gdb/testsuite] Fix /gdb.guile/scm-parameter.exp " Tom de Vries
@ 2023-03-29 6:02 ` Tom de Vries
4 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2023-03-29 6:02 UTC (permalink / raw)
To: gdb-patches
Fix test-case gdb.guile/scm-symbol.exp for remote host by making a regexp less
strict.
Likewise in gdb.guile/scm-symtab.exp.
Tested on x86_64-linux.
---
gdb/testsuite/gdb.guile/scm-symbol.exp | 2 +-
gdb/testsuite/gdb.guile/scm-symtab.exp | 13 +++++++++----
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/gdb/testsuite/gdb.guile/scm-symbol.exp b/gdb/testsuite/gdb.guile/scm-symbol.exp
index 5680a7f176a..8c6cbd250ae 100644
--- a/gdb/testsuite/gdb.guile/scm-symbol.exp
+++ b/gdb/testsuite/gdb.guile/scm-symbol.exp
@@ -132,7 +132,7 @@ gdb_test "guile (print (= (symbol-addr-class t) SYMBOL_LOC_CONST))" "= #t"
gdb_test "guile (print (symbol-type t))" "= enum tag"
# Test symtab attribute.
-gdb_test "guile (print (symbol-symtab t))" "= #<gdb:symtab .*gdb.guile/scm-symbol.c>"
+gdb_test "guile (print (symbol-symtab t))" "= #<gdb:symtab (.*/)?scm-symbol.c>"
# C++ tests
# Recompile binary.
diff --git a/gdb/testsuite/gdb.guile/scm-symtab.exp b/gdb/testsuite/gdb.guile/scm-symtab.exp
index 0f468b7d373..a8cc2825ae0 100644
--- a/gdb/testsuite/gdb.guile/scm-symtab.exp
+++ b/gdb/testsuite/gdb.guile/scm-symtab.exp
@@ -61,7 +61,7 @@ gdb_scm_test_silent_cmd "guile (define new-pc (sal-pc (frame-sal (selected-frame
# Test sal.
gdb_test "guile (print (sal-symtab sal))" \
- ".*gdb.guile/scm-symtab.c.*" "Test sal-symtab"
+ " (.*/)?scm-symtab.c.*" "Test sal-symtab"
gdb_test "guile (print (sal-pc sal))" \
"${decimal}" "test sal-pc"
gdb_test "guile (print (= (sal-last sal) (- new-pc 1)))" \
@@ -85,11 +85,16 @@ gdb_test "guile (print (eq? symtab (symbol-symtab (lookup-global-symbol \"func1\
# Test symbol table.
gdb_test "guile (print (symtab-filename symtab))" \
- ".*gdb.guile/scm-symtab.c.*" "test symtab-filename"
+ " (.*/)?scm-symtab.c.*" "test symtab-filename"
gdb_test "guile (print (symtab-objfile symtab))" \
"#<gdb:objfile .*scm-symtab>" "test symtab-objfile"
-gdb_test "guile (print (symtab-fullname symtab))" \
- "testsuite/gdb.guile/scm-symtab.c.*" "test symtab-fullname"
+if { [is_remote host] } {
+ gdb_test "guile (print (symtab-fullname symtab))" \
+ " (.*/)scm-symtab.c.*" "test symtab-fullname"
+} else {
+ gdb_test "guile (print (symtab-fullname symtab))" \
+ "testsuite/gdb.guile/scm-symtab.c.*" "test symtab-fullname"
+}
gdb_test "guile (print (symtab-valid? symtab))" \
"#t" "test symtab-valid?"
gdb_test "guile (print (->bool (member \"qq\" global-symbols)))" \
--
2.35.3
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-03-29 6:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-29 6:01 [pushed 1/6] [gdb/testsuite] Fix gdb.guile/guile.exp for remote host Tom de Vries
2023-03-29 6:02 ` [pushed 2/6] [gdb/testsuite] Fix gdb.guile/scm-cmd.exp without readline Tom de Vries
2023-03-29 6:02 ` [pushed 3/6] [gdb/testsuite] Fix gdb.guile/scm-objfile-script.exp for remote host Tom de Vries
2023-03-29 6:02 ` [pushed 4/6] " Tom de Vries
2023-03-29 6:02 ` [pushed 5/6] [gdb/testsuite] Fix /gdb.guile/scm-parameter.exp " Tom de Vries
2023-03-29 6:02 ` [pushed 6/6] [gdb/testsuite] Fix gdb.guile/scm-symbol.exp " Tom de Vries
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).