Automatic Copyright Year update after running gdb/copyright.py
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.python / py-framefilter-invalidarg.exp
1 # Copyright (C) 2014-2022 Free Software Foundation, Inc.
2
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.
7 #
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.
12 #
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/>.
15
16 load_lib gdb-python.exp
17
18 standard_testfile amd64-py-framefilter-invalidarg.S
19
20 if { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
21 verbose "Skipping py-framefilter-invalidarg."
22 return
23 }
24
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} {
28 return -1
29 }
30
31 # Start with a fresh gdb.
32 gdb_exit
33 gdb_start
34
35 # Skip all tests if Python scripting is not enabled.
36 if { [skip_python_tests] } { continue }
37
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
40 # gdb will find it.
41 set remote_obj_python_file \
42 [remote_download \
43 host ${srcdir}/${subdir}/${testfile}-gdb.py \
44 [standard_output_file ${testfile}-gdb.py]]
45
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"
49 gdb_load ${binfile}
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"
53
54 if ![runto_main] then {
55 perror "couldn't run to breakpoint"
56 return
57 }
58 gdb_test_no_output "set python print-stack full" \
59 "set python print-stack to full"
60
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"
65
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"
This page took 0.029771 seconds and 4 git commands to generate.