Commit | Line | Data |
---|---|---|
88b9d363 | 1 | # Copyright (C) 2021-2022 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 | ||
20 | load_lib gdb-python.exp | |
21 | ||
22 | standard_testfile | |
23 | ||
24 | if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { | |
25 | return -1 | |
26 | } | |
27 | ||
28 | # Skip all tests if Python scripting is not enabled. | |
29 | if { [skip_python_tests] } { continue } | |
30 | ||
31 | if ![runto_main] { | |
32 | return -1 | |
33 | } | |
34 | ||
35 | # Run to our test breakpoint. | |
36 | gdb_breakpoint [gdb_get_line_number "Break here"] | |
37 | gdb_continue_to_breakpoint "run to test breakpoint" | |
38 | ||
39 | gdb_test "bt" \ | |
40 | [multi_line \ | |
41 | "#0 func3 \\(\\) at \[^\r\n\]+/py-framefilter-addr.c:21" \ | |
42 | "#1 $hex in func2 \\(\\) at \[^\r\n\]+/py-framefilter-addr.c:27" \ | |
43 | "#2 $hex in func1 \\(\\) at \[^\r\n\]+/py-framefilter-addr.c:33" \ | |
44 | "#3 $hex in main \\(\\) at \[^\r\n\]+/py-framefilter-addr.c:39" ] \ | |
45 | "backtrace without frame filters" | |
46 | ||
47 | # Make the frame filters Python script available. | |
48 | set remote_python_file \ | |
49 | [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py \ | |
50 | ${testfile}.py] | |
51 | ||
52 | # And load it into GDB. | |
53 | gdb_test_no_output "source ${remote_python_file}" "load python file" | |
54 | ||
55 | gdb_test "bt" \ | |
56 | [multi_line \ | |
57 | "#0 func3 \\(\\) at \[^\r\n\]+/py-framefilter-addr.c:21" \ | |
58 | "#1 $hex in func2 \\(\\) at \[^\r\n\]+/py-framefilter-addr.c:27" \ | |
59 | "#2 $hex in func1 \\(\\) at \[^\r\n\]+/py-framefilter-addr.c:33" \ | |
60 | "#3 $hex in main \\(\\) at \[^\r\n\]+/py-framefilter-addr.c:39" ] \ | |
61 | "backtrace with frame filters" |