1 # Copyright (C) 2014-2019 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 load_lib gdb-python.exp
18 standard_testfile amd64-py-framefilter-invalidarg.S
20 if { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
21 verbose "Skipping py-framefilter-invalidarg."
25 # We cannot use prepare_for_testing as we have to set the safe-patch
26 # to check objfile and progspace printers.
27 if {[build_executable $testfile.exp $testfile $srcfile {}] == -1} {
31 # Start with a fresh gdb.
35 # Skip all tests if Python scripting is not enabled.
36 if { [skip_python_tests] } { continue }
38 # Make the -gdb.py script available to gdb, it is automagically loaded by gdb.
39 # Care is taken to put it in the same directory as the binary so that
41 set remote_obj_python_file \
43 host ${srcdir}/${subdir}/${testfile}-gdb.py.in \
44 [standard_output_file ${testfile}-gdb.py]]
46 gdb_reinitialize_dir $srcdir/$subdir
47 gdb_test_no_output "set auto-load safe-path ${remote_obj_python_file}" \
48 "set auto-load safe-path"
50 # Verify gdb loaded the script.
51 gdb_test "info auto-load python-scripts" "Yes.*/${testfile}-gdb.py.*" \
52 "Test auto-load had loaded python scripts"
54 if ![runto_main] then {
55 perror "couldn't run to breakpoint"
58 gdb_test_no_output "set python print-stack full" \
59 "set python print-stack to full"
61 # Load global frame-filters
62 set remote_python_file [gdb_remote_download host \
63 ${srcdir}/${subdir}/${testfile}.py]
64 gdb_test_no_output "source ${remote_python_file}" "load python file"
66 gdb_test "bt" "niam \\(argc=<error reading variable: dwarf expression stack underflow>, argv=0x\[0-9a-f\]+\\) at py-framefilter-invalidarg.c:\[0-9\]+" "bt full with filters"