1 # Copyright 2021-2024 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 # Set a breakpoint on a local copy of glibc's _exit, and verify that it
17 # triggers. The function does a syscall immediately after the prologue, and
18 # if the breakpoint is set past the syscall due to faulty prologue skipping,
19 # the breakpoint will not trigger.
21 # In particular, we're trying to excercise the instruction analysis
22 # functionality of prologue skipping. If non-minimal symbols are
23 # read, then that functionality might not be used because f.i.
24 # line-info is used instead. So, we use nodebug.
26 require {istarget "powerpc*"} is_lp64_target
29 if [info exists COMPILE] {
30 standard_testfile .c -main.c
31 lappend flags optimize=-O2
32 lappend flags additional_flags=-fno-stack-protector
33 lappend flags additional_flags=-mlong-double-128
34 lappend flags additional_flags=-fpic
35 lappend flags additional_flags=-ftls-model=initial-exec
37 standard_testfile .s -main.c
40 if { [prepare_for_testing "failed to prepare" ${testfile} \
41 [list $srcfile $srcfile2] $flags] } {
49 gdb_breakpoint "_exit"
51 # If the skip_prologue analysis of _exit is too eager, we may not hit the
53 gdb_continue_to_breakpoint "_exit" "_exit \\(\\).*"