1# Copyright 2010-2013 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 16set testfile "nostdlib" 17set srcfile ${testfile}.c 18set executable ${testfile} 19set binfile ${objdir}/${subdir}/${executable} 20 21# If we're using a stub, breakpoints at the entry point will not trigger. 22# See also the comment in break-entry.exp. 23 24if [target_info exists use_gdb_stub] { 25 untested ${testfile}.exp 26 return 27} 28 29# default_target_compile would otherwise add "-lm" making the testcase 30# dependent on whether the system libraries are already prelinked. 31# prelink: Could not set /lib64/libm-2.11.1.so owner or mode: Operation not permitted 32set compile { 33 gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-nostdlib} 34} 35set board [target_info name] 36if [board_info $board exists mathlib] { 37 set mathlib [board_info $dest mathlib] 38 set_board_info mathlib "" 39 set err [eval $compile] 40 set_board_info mathlib $mathlib 41} else { 42 set_board_info mathlib "" 43 set err [eval $compile] 44 unset_board_info mathlib 45} 46if {$err != ""} { 47 untested ${testfile}.exp 48 return -1 49} 50 51clean_restart $executable 52 53gdb_breakpoint "*marker" 54gdb_breakpoint "*_start" 55 56gdb_run_cmd 57 58# Breakpoint 2, Stopped due to shared library event 59# _start () at ./gdb.base/nostdlib.c:20 60gdb_test "" {Breakpoint [0-9]+, .*_start .*} "stop at run" 61 62gdb_test "continue" {Breakpoint [0-9]+, marker .*} "continue to marker" 63