]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.linespec/break-asm-file.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.linespec / break-asm-file.exp
CommitLineData
1d506c26 1# Copyright 2012-2024 Free Software Foundation, Inc.
87186c6a
MMN
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# Bug 17394
17# Test for break-point at a function only for a selected ASM file.
18
19load_lib dwarf.exp
20
21standard_testfile .c
22set execfile $testfile
a2ee3a8f
TV
23set asm_file1 break-asm-file1.S
24set asm_file0 break-asm-file0.S
87186c6a
MMN
25
26# This test can only be run on targets which support DWARF-2 and use gas.
ce8d533e 27require dwarf2_support
87186c6a 28
85180498
YQ
29if {[gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \
30 object {debug nowarnings optimize=-O0}] != ""} {
31 return -1
32}
33
34# Compile .s files without debug information.
35if {[gdb_compile ${srcdir}/${subdir}/$asm_file0 ${binfile}2.o \
36 object {nodebug}] != ""} {
37 return -1
38}
39if {[gdb_compile ${srcdir}/${subdir}/$asm_file1 ${binfile}3.o \
40 object {nodebug}] != ""} {
41 return -1
42}
43
44if {[gdb_compile [list ${binfile}1.o ${binfile}2.o ${binfile}3.o] \
45 "${binfile}" executable {}] != ""} {
46 return -1
87186c6a
MMN
47}
48
49clean_restart $execfile
50
51gdb_test "break a/$asm_file0:func" \
52 "Breakpoint 1 at 0x\[0-9a-fA-F\]+: file .*a/$asm_file0, line 7\\\." \
53 "set a break-point at a global function only for a selected ASM file."
54
55gdb_test "delete 1"
56
57gdb_test "break b/$asm_file0:func" \
58 "Breakpoint 2 at 0x\[0-9a-fA-F\]+: file .*b/$asm_file0, line 7\\\." \
59 "set a break-point at a function only for a selected ASM file."
60
61gdb_test "delete 2"
62
63gdb_test "break $asm_file0:func" \
64 "Breakpoint 3 at 0x\[0-9a-fA-F\]+: .*$asm_file0.*(2 locations).*" \
65 "set a break-point at function in all instances for a selected ASM file."
66