1254721Semaste# Copyright 2012-2020 Free Software Foundation, Inc.
2254721Semaste#
3254721Semaste# This program is free software; you can redistribute it and/or modify
4254721Semaste# it under the terms of the GNU General Public License as published by
5254721Semaste# the Free Software Foundation; either version 3 of the License, or
6254721Semaste# (at your option) any later version.
7254721Semaste#
8254721Semaste# This program is distributed in the hope that it will be useful,
9254721Semaste# but WITHOUT ANY WARRANTY; without even the implied warranty of
10254721Semaste# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11254721Semaste# GNU General Public License for more details.
12254721Semaste#
13254721Semaste# You should have received a copy of the GNU General Public License
14254721Semaste# along with this program.  If not, see <http://www.gnu.org/licenses/>.
15254721Semaste
16254721Semasteload_lib "ada.exp"
17254721Semaste
18254721Semasteif { [skip_ada_tests] } { return -1 }
19254721Semaste
20254721Semastestandard_ada_testfile p
21254721Semaste
22254721Semasteif {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
23254721Semaste  return -1
24254721Semaste}
25254721Semaste
26254721Semasteclean_restart ${testfile}
27254721Semaste
28254721Semaste# Force GDB to convert the psymtab of pck.adb into a symtab.
29254721Semastegdb_test "list pck.adb:1" \
30254721Semaste         "$decimal\[ \t\]+--  Copyright.*"
31254721Semaste
32254721Semaste# Break on subprogram "Archive". There is an enumeral that's an
33254721Semaste# homonym, so verify that GDB doesn't provide the choice between
34254721Semaste# the subprogram and the enumeral for the location of the breakpoint.
35254721Semaste# Instead, it should insert the breakpoint on the function alone.
36254721Semaste
37254721Semastegdb_test "break archive" \
38254721Semaste         "Breakpoint $decimal at $hex: file .*pck.adb, line $decimal\\."
39254721Semaste
40254721Semaste# Run the program. Make sure the program runs until it hits
41254721Semaste# the breakpoint and that the debugger does not unexpectedly ask
42254721Semaste# the user to choose between several locations for the breakpoint
43254721Semaste# (while the inferior is starting up, new DSOs being mapped causes
44254721Semaste# the breakpoint location to be reevaluated).
45254721Semaste
46254721Semastegdb_run_cmd
47254721Semastegdb_test "" \
48254721Semaste         "Breakpoint $decimal, pck\\.archive \\(\\).*" \
49254721Semaste         "run to pck.archive breakpoint"
50254721Semaste
51254721Semaste