xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/testsuite/gdb.base/info-program.exp (revision 7bdf38e5b7a28439665f2fdeff81e36913eef7dd)
1# Copyright 1997-2023 Free Software Foundation, Inc.
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
16standard_testfile normal.c
17
18if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
19    return -1
20}
21
22if { ![runto_main] } {
23    return -1
24}
25
26gdb_test "info program" "Program stopped at $hex\.\r\nIt stopped at breakpoint $decimal\.\r\nType \"info stack\" or \"info registers\" for more information\." \
27    "info program after run to main"
28
29# We don't really care where this step lands, so long as GDB reports
30# that the inferior stopped  due to a step in the subsequent test.
31gdb_test "next" ".*" "step before info program"
32
33gdb_test "info program" "Program stopped at $hex\.\r\nIt stopped after being stepped\.\r\nType \"info stack\" or \"info registers\" for more information\." \
34    "info program after next"
35
36if {![runto_main]} {
37    return -1
38}
39
40delete_breakpoints
41
42gdb_test "info program" "Program stopped at $hex\.\r\nIt stopped at a breakpoint that has since been deleted\.\r\nType \"info stack\" or \"info registers\" for more information\." \
43    "info program after deleting all breakpoints"
44