]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.python/py-framefilter-addr.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.python / py-framefilter-addr.exp
CommitLineData
1d506c26 1# Copyright (C) 2021-2024 Free Software Foundation, Inc.
7807d76a
AB
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# This file is part of the GDB testsuite. It tests Python-based
17# frame-filters when the 'function ()' method on FrameDecorator
18# returns the address for the function being decorated.
19
20load_lib gdb-python.exp
21
d82e5429 22require allow_python_tests
79749205 23
7807d76a
AB
24standard_testfile
25
26if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
27 return -1
28}
29
7807d76a
AB
30if ![runto_main] {
31 return -1
32}
33
34# Run to our test breakpoint.
35gdb_breakpoint [gdb_get_line_number "Break here"]
36gdb_continue_to_breakpoint "run to test breakpoint"
37
38gdb_test "bt" \
39 [multi_line \
40 "#0 func3 \\(\\) at \[^\r\n\]+/py-framefilter-addr.c:21" \
41 "#1 $hex in func2 \\(\\) at \[^\r\n\]+/py-framefilter-addr.c:27" \
42 "#2 $hex in func1 \\(\\) at \[^\r\n\]+/py-framefilter-addr.c:33" \
43 "#3 $hex in main \\(\\) at \[^\r\n\]+/py-framefilter-addr.c:39" ] \
44 "backtrace without frame filters"
45
46# Make the frame filters Python script available.
47set remote_python_file \
48 [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py \
49 ${testfile}.py]
50
51# And load it into GDB.
52gdb_test_no_output "source ${remote_python_file}" "load python file"
53
54gdb_test "bt" \
55 [multi_line \
56 "#0 func3 \\(\\) at \[^\r\n\]+/py-framefilter-addr.c:21" \
57 "#1 $hex in func2 \\(\\) at \[^\r\n\]+/py-framefilter-addr.c:27" \
58 "#2 $hex in func1 \\(\\) at \[^\r\n\]+/py-framefilter-addr.c:33" \
59 "#3 $hex in main \\(\\) at \[^\r\n\]+/py-framefilter-addr.c:39" ] \
60 "backtrace with frame filters"