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