1 # Copyright 2022-2023 Free Software Foundation, Inc.
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.
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.
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/>.
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
30 if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
40 set until_to_line [gdb_get_line_number "until to here"]
42 gdb_test "until $until_to_line" \
44 "until \$line, in main"