1# -*- shell-script -*-
2# gdb-like "info program" debugger command
3#
4#   Copyright (C) 2010-2011, 2016 Rocky Bernstein <rocky@gnu.org>
5#
6#   This program is free software; you can redistribute it and/or
7#   modify it under the terms of the GNU General Public License as
8#   published by the Free Software Foundation; either version 2, or
9#   (at your option) any later version.
10#
11#   This program is distributed in the hope that it will be useful,
12#   but WITHOUT ANY WARRANTY; without even the implied warranty of
13#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14#   General Public License for more details.
15#
16#   You should have received a copy of the GNU General Public License
17#   along with this program; see the file COPYING.  If not, write to
18#   the Free Software Foundation, 59 Temple Place, Suite 330, Boston,
19#   MA 02111 USA.
20
21_Dbg_help_add_sub info program '
22**info program**
23
24Information about debugged program stopping point.
25
26See also:
27---------
28
29\"info line\".' 1
30
31_Dbg_do_info_program() {
32    if (( _Dbg_running )) ; then
33	_Dbg_msg "Program stopped."
34	if [[ -n $_Dbg_stop_reason ]] ; then
35	    _Dbg_msg "It stopped ${_Dbg_stop_reason}."
36	fi
37	if [[ -n $_Dbg_bash_command ]] ; then
38	    _Dbg_msg "Next statement to be run is:\n\t${_Dbg_bash_command}"
39	fi
40    else
41	_Dbg_errmsg "The program being debugged is not being run."
42    fi
43    return $?
44}
45