2011-05-30 Yao Qi <yao@codesourcery.com>
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / nostdlib.exp
1 # Copyright 2010, 2011 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 set testfile "nostdlib"
17 set srcfile ${testfile}.c
18 set executable ${testfile}
19 set binfile ${objdir}/${subdir}/${executable}
20
21 # default_target_compile would otherwise add "-lm" making the testcase
22 # dependent on whether the system libraries are already prelinked.
23 # prelink: Could not set /lib64/libm-2.11.1.so owner or mode: Operation not permitted
24 set compile {
25 gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-nostdlib}
26 }
27 set board [target_info name]
28 if [board_info $board exists mathlib] {
29 set mathlib [board_info $dest mathlib]
30 set_board_info mathlib ""
31 set err [eval $compile]
32 set_board_info mathlib $mathlib
33 } else {
34 set_board_info mathlib ""
35 set err [eval $compile]
36 unset_board_info mathlib
37 }
38 if {$err != ""} {
39 untested ${testfile}.exp
40 return -1
41 }
42
43 clean_restart $executable
44
45 gdb_breakpoint "*marker"
46 gdb_breakpoint "*_start"
47
48 gdb_run_cmd
49
50 # Breakpoint 2, Stopped due to shared library event
51 # _start () at ./gdb.base/nostdlib.c:20
52 gdb_test "" {Breakpoint [0-9]+, .*_start .*} "stop at run"
53
54 gdb_test "continue" {Breakpoint [0-9]+, marker .*} "continue to marker"
This page took 0.030928 seconds and 4 git commands to generate.