]>
Commit | Line | Data |
---|---|---|
1d506c26 | 1 | # Copyright 2022-2024 Free Software Foundation, Inc. |
0f443d1b PA |
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 "until LINE", started in the "main()" frame, where the until | |
17 | # command runs into a longjmp that lands in a frame that is inner than | |
18 | # main. GDB internally intercepts the longjmp, sets a breakpoint at | |
19 | # the jump destination, and once there, decides whether to stop or | |
20 | # ignore the breakpoint hit depending on whether the initiating frame | |
21 | # is present on the frame chain. GDB used to have a bug where it | |
22 | # recorded the frame of the caller of main instead of the frame of | |
23 | # main as the initiating frame, and then later on when deciding | |
24 | # whether the longjmp landed somewhere inner than main, since | |
25 | # unwinding normally stops at main, GDB would fail to find the | |
26 | # initiating frame. | |
27 | ||
28 | standard_testfile | |
29 | ||
30 | if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} { | |
31 | return | |
32 | } | |
33 | ||
34 | if {![runto_main]} { | |
35 | return | |
36 | } | |
37 | ||
38 | delete_breakpoints | |
39 | ||
40 | set until_to_line [gdb_get_line_number "until to here"] | |
41 | ||
42 | gdb_test "until $until_to_line" \ | |
43 | " until to here .*" \ | |
44 | "until \$line, in main" |