Automatic Copyright Year update after running gdb/copyright.py
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.python / py-pending-frame-level.exp
CommitLineData
88b9d363 1# Copyright (C) 2021-2022 Free Software Foundation, Inc.
d52b8007
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# Test gdb.PendingFrame.level method.
17
18load_lib gdb-python.exp
19
20standard_testfile
21
22if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
23 return -1
24}
25
26# Skip all tests if Python scripting is not enabled.
27if { [skip_python_tests] } { continue }
28
29if ![runto_main] then {
30 fail "can't run to main"
31 return 0
32}
33
34set pyfile [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py]
35
36gdb_breakpoint [gdb_get_line_number "Break here"]
37gdb_continue_to_breakpoint "stop at test breakpoint"
38
39# An initial look at the stack to ensure it is correct.
40gdb_test_sequence "bt" "Initial backtrace" {
41 "\\r\\n#0 \[^\r\n\]* f0 \\(\\) at "
42 "\\r\\n#1 \[^\r\n\]* f1 \\(\\) at "
43 "\\r\\n#2 \[^\r\n\]* f2 \\(\\) at "
44 "\\r\\n#3 \[^\r\n\]* f3 \\(\\) at "
45 "\\r\\n#4 \[^\r\n\]* main \\(\\) at "
46}
47
48# Load the script containing the unwinder.
49gdb_test_no_output "source ${pyfile}"\
50 "import python scripts"
51
52# Now look at the stack again, we should see output from the Python
53# unwinder mixed in.
54gdb_test_sequence "bt" "Backtrace with extra Python output" {
55 "Func f0, Level 0"
56 "Func f1, Level 1"
57 "\\r\\n#0 \[^\r\n\]* f0 \\(\\) at "
58 "\\r\\n#1 \[^\r\n\]* f1 \\(\\) at "
59 "Func f2, Level 2"
60 "\\r\\n#2 \[^\r\n\]* f2 \\(\\) at "
61 "Func f3, Level 3"
62 "\\r\\n#3 \[^\r\n\]* f3 \\(\\) at "
63 "Func main, Level 4"
64 "\\r\\n#4 \[^\r\n\]* main \\(\\) at "
65}
This page took 0.037041 seconds and 4 git commands to generate.