]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.ada/task_bp.exp
Update copyright year range in all GDB files
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.ada / task_bp.exp
CommitLineData
e2882c85 1# Copyright 2011-2018 Free Software Foundation, Inc.
9ac7f98e
JB
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
16load_lib "ada.exp"
17
8223e12c 18standard_ada_testfile foo
9ac7f98e 19
9ac7f98e
JB
20if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
21 return -1
22}
23
24# Insert a breakpoint at LOC, and run the program expecting us to
25# reach that breakpoint.
26#
27# LOC is expected to be a linespec referencing the body of task
28# Pck.Dummy_Task (the purpose is to test all the variations of
29# these equivalent linespecs).
30#
31# MSG is just a string that's used to qualify the name of the tests
32# that are executed inside that procedure. The purpose to be able
33# to call that function multiple times with the same linespec, in
34# order to test one given linespec under multiple conditions.
35
36proc test_bp { loc msg } {
37 gdb_test "break $loc" \
38 "Breakpoint \[0-9\]+ at 0x\[0-9a-fA-F\]+: file .*pck.adb, line \[0-9\]+\." \
39 "break $loc - $msg"
40
41 gdb_run_cmd
42 gdb_test "" \
43 "Breakpoint \[0-9\]+, pck\\.dummy_task (.*)" \
44 "run to $loc - $msg"
45}
46
47set all_linespecs { "pck.dummy_task" "dummy_task"
48 "pck.adb:pck.dummy_task" "pck.adb:dummy_task"}
49
50# First, test the linespecs when the associated symtab hasn't been
51# expanded yet.
52
53foreach linespec $all_linespecs {
54 clean_restart ${testfile}
55 test_bp $linespec "from psymtab"
56}
57
58# Now, do the same, but with the associated symtab already expanded.
59
60foreach linespec $all_linespecs {
61 clean_restart ${testfile}
62 gdb_test "list pck.adb:1" ".*" "expanding symtab for $linespec"
63 test_bp $linespec "from full symtab"
64}