1 # Copyright 2012-2015 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/>.
17 # Test for break-point at a function only for a selected ASM file.
22 set execfile $testfile
23 set asm_file1 break-asm-file1.s
24 set asm_file0 break-asm-file0.s
26 # This test can only be run on targets which support DWARF-2 and use gas.
27 if {![dwarf2_support]} {
31 if {[prepare_for_testing ${testfile}.exp $execfile \
32 [list $srcfile $asm_file1 $asm_file0] \
33 {debug nowarnings optimize=-O0}]} {
34 untested "Skipping ${testfile}."
38 clean_restart $execfile
40 gdb_test "break a/$asm_file0:func" \
41 "Breakpoint 1 at 0x\[0-9a-fA-F\]+: file .*a/$asm_file0, line 7\\\." \
42 "set a break-point at a global function only for a selected ASM file."
46 gdb_test "break b/$asm_file0:func" \
47 "Breakpoint 2 at 0x\[0-9a-fA-F\]+: file .*b/$asm_file0, line 7\\\." \
48 "set a break-point at a function only for a selected ASM file."
52 gdb_test "break $asm_file0:func" \
53 "Breakpoint 3 at 0x\[0-9a-fA-F\]+: .*$asm_file0.*(2 locations).*" \
54 "set a break-point at function in all instances for a selected ASM file."