aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.linespec/break-asm-file.exp
blob: c3e18dc51e49484c7b188639a1a02f882641acf6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Copyright 2012-2015 Free Software Foundation, Inc.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# Bug 17394
# Test for break-point at a function only for a selected ASM file.

load_lib dwarf.exp

standard_testfile .c
set execfile $testfile
set asm_file1 break-asm-file1.s
set asm_file0 break-asm-file0.s

# This test can only be run on targets which support DWARF-2 and use gas.
if {![dwarf2_support]} {
    return 0
}

if {[prepare_for_testing ${testfile}.exp $execfile \
	 [list $srcfile $asm_file1 $asm_file0] \
	 {debug nowarnings optimize=-O0}]} {
    untested "Skipping ${testfile}."
    return
}

clean_restart $execfile

gdb_test "break a/$asm_file0:func" \
    "Breakpoint 1 at 0x\[0-9a-fA-F\]+: file .*a/$asm_file0, line 7\\\." \
    "set a break-point at a global function only for a selected ASM file."

gdb_test "delete 1"

gdb_test "break b/$asm_file0:func" \
    "Breakpoint 2 at 0x\[0-9a-fA-F\]+: file .*b/$asm_file0, line 7\\\." \
    "set a break-point at a function only for a selected ASM file."

gdb_test "delete 2"

gdb_test "break $asm_file0:func" \
    "Breakpoint 3 at 0x\[0-9a-fA-F\]+: .*$asm_file0.*(2 locations).*" \
    "set a break-point at function in all instances for a selected ASM file."