diff options
Diffstat (limited to 'gdb/testsuite/gdb.guile/scm-section-script.exp')
-rw-r--r-- | gdb/testsuite/gdb.guile/scm-section-script.exp | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.guile/scm-section-script.exp b/gdb/testsuite/gdb.guile/scm-section-script.exp index 93a10a0..8c04ac8 100644 --- a/gdb/testsuite/gdb.guile/scm-section-script.exp +++ b/gdb/testsuite/gdb.guile/scm-section-script.exp @@ -53,14 +53,51 @@ gdb_start 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." @@ -74,3 +111,5 @@ gdb_test "b [gdb_get_line_number {break to inspect} ${testfile}.c ]" \ 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" |