if { [skip_guile_tests] } { continue }
gdb_reinitialize_dir $srcdir/$subdir
-gdb_test_no_output "set auto-load safe-path ${remote_guile_file}" \
+
+# Try first with a restrictive safe-path.
+
+gdb_test_no_output "set auto-load safe-path /restricted" \
+ "set restricted auto-load safe-path"
+gdb_load ${binfile}
+
+# Verify gdb did not load the scripts.
+set test_name "verify scripts not loaded"
+gdb_test_multiple "info auto-load guile-scripts" "$test_name" {
+ -re "Yes.*${testfile}.scm.*Yes.*inlined-script.*$gdb_prompt $" {
+ fail "$test_name"
+ }
+ -re "No.*${testfile}.scm.*No.*inlined-script.*$gdb_prompt $" {
+ pass "$test_name"
+ }
+}
+
+# Try again with a working safe-path.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test_no_output "set auto-load safe-path ${remote_guile_file}:${binfile}" \
"set auto-load safe-path"
gdb_load ${binfile}
-# Verify gdb loaded the script.
-gdb_test "info auto-load guile-scripts" "Yes.*${testfile}.scm.*"
+# Verify gdb loaded each script and they appear once in the list.
+set test_name "verify scripts loaded"
+gdb_test_multiple "info auto-load guile-scripts" "$test_name" {
+ -re "${testfile}.scm.*${testfile}.scm.*$gdb_prompt $" {
+ fail "$test_name"
+ }
+ -re "inlined-script.*inlined-script.*$gdb_prompt $" {
+ fail "$test_name"
+ }
+ -re "Yes.*${testfile}.scm.*Yes.*inlined-script.*$gdb_prompt $" {
+ pass "$test_name"
+ }
+}
+
# Again, with a regexp this time.
gdb_test "info auto-load guile-scripts ${testfile}" "Yes.*${testfile}.scm.*"
+
# Again, with a regexp that matches no scripts.
gdb_test "info auto-load guile-scripts no-script-matches-this" \
"No auto-load scripts matching no-script-matches-this."
gdb_test "continue" ".*Breakpoint.*"
gdb_test "print ss" " = a=<1> b=<2>"
+
+gdb_test "test-cmd 1 2 3" "test-cmd output, arg = 1 2 3"