"Fossies" - the Fresh Open Source Software Archive

Member "bashdb-5.0-1.1.0/init/vars.sh" (2 Sep 2019, 2478 Bytes) of package /linux/privat/bashdb-5.0-1.1.0.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "vars.sh": 4.4-1.0.1_vs_5.0-1.1.0.

    1 # -*- shell-script -*-
    2 # vars.sh - Bourne Again Shell Debugger Global Variables
    3 #
    4 #   Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008, 2009 Rocky Bernstein
    5 #   2011, 2019 <rocky@gnu.org>
    6 #
    7 #   This program is free software; you can redistribute it and/or
    8 #   modify it under the terms of the GNU General Public License as
    9 #   published by the Free Software Foundation; either version 2, or
   10 #   (at your option) any later version.
   11 #
   12 #   This program is distributed in the hope that it will be useful,
   13 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
   14 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   15 #   General Public License for more details.
   16 #
   17 #   You should have received a copy of the GNU General Public License
   18 #   along with this program; see the file COPYING.  If not, write to
   19 #   the Free Software Foundation, 59 Temple Place, Suite 330, Boston,
   20 #   MA 02111 USA.
   21 
   22 # Note: the trend now is to move initializations which are generally
   23 # used in only one sub-part (e.g. variables for break/watch/actions) to
   24 # the corresponding file.
   25 
   26 [[ -z $_Dbg_init_ver ]] || return
   27 
   28 typeset _Dbg_cur_fn          # current function of debugged program
   29 
   30 # If called from bashdb script rather than via "bash --debugger", skip
   31 # over some initial setup commands, like the initial "source" function
   32 # of debugged shell script.
   33 
   34 if [[ -n $_Dbg_script ]] ; then
   35   _Dbg_step_ignore=3
   36 else
   37   typeset -i _Dbg_n=$#
   38   typeset -i _Dbg_i
   39 fi
   40 
   41 typeset -i _Dbg_need_input=1   # True if we need to reassign input.
   42 typeset -i _Dbg_brkpt_num=0    # If nonzero, the breakpoint number that we
   43                                # are currently stopped at.
   44 typeset last_next_step_cmd='s' # Default is step.
   45 typeset _Dbg_last_print=''     # expression on last print command
   46 typeset _Dbg_last_printe=''    # expression on last print expression command
   47 
   48 # strings to save and restore the setting of `extglob' in debugger functions
   49 # that need it
   50 typeset _seteglob='local __eopt=-u ; shopt -q extglob && __eopt=-s ; shopt -s extglob'
   51 typeset _resteglob='shopt $__eopt extglob'
   52 
   53 typeset int_pat='[0-9]*([0-9])'
   54 typeset _Dbg_signed_int_pat='?([-+])+([0-9])'
   55 
   56 # Set tty to use for output.
   57 if [[ -z $_Dbg_tty ]] ; then
   58   typeset -x _Dbg_tty
   59   _Dbg_tty=$(tty)
   60   [[ $? != 0 ]] && _Dbg_tty=''
   61 fi
   62 
   63 # If _Dbg_QUIT_LEVELS is set to a positive number, this is the number
   64 # of levels (subshell or shell nestings) or we should exit out of.
   65 [[ -z $_Dbg_QUIT_LEVELS ]] && _Dbg_QUIT_LEVELS=0