Add "info connections" command, "info inferiors" connection number/string
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.python / py-unwind.exp
1 # Copyright (C) 2015-2020 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 # This file is part of the GDB testsuite. It verifies that frame
17 # unwinders can be implemented in Python.
18
19 load_lib gdb-python.exp
20
21 standard_testfile
22
23 # Stack protection can make the stack look a bit different, breaking the
24 # assumptions this test has about its layout.
25
26 set flags "additional_flags=-fno-stack-protector"
27
28 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} "debug $flags"] } {
29 return -1
30 }
31
32 # Skip all tests if Python scripting is not enabled.
33 if { [skip_python_tests] } { continue }
34
35 # This test runs on a specific platform.
36 if { ![istarget x86_64-*-* ] || ![is_lp64_target] } { continue }
37
38 # The following tests require execution.
39
40 if ![runto_main] then {
41 fail "can't run to main"
42 return 0
43 }
44
45 set pyfile [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py]
46
47 gdb_breakpoint [gdb_get_line_number "break backtrace-broken"]
48
49 gdb_test "source ${pyfile}" "Python script imported" \
50 "import python scripts"
51
52 gdb_continue_to_breakpoint "break backtrace-broken"
53 gdb_test_sequence "where" "Backtrace restored by unwinder" {
54 "\\r\\n#0 .* corrupt_frame_inner \\(\\) at "
55 "\\r\\n#1 .* corrupt_frame_outer \\(\\) at "
56 "\\r\\n#2 .* main \\(.*\\) at"
57 }
58
59 # Check that the Python unwinder frames can be flushed / released.
60 gdb_test "flushregs" "Register cache flushed\\." "flush frames"
This page took 0.031186 seconds and 4 git commands to generate.