# `.dbxinit compatibility mode' means that dbx will automatically alias `alias'
# to `dalias' and read your .dbxinit file if no .dbxrc file is found.  See
# `help alias' and `help startup' for more information.  (This is for backward
# compatibility and may not be supported in future releases.)

# You can prevent the startup message:
#   Using .dbxinit compatibility mode.  See `help .dbxrc' for more information.
# by creating a .dbxrc file.  It may be empty, but the contents of this message
# make a good starting point.  You may use the command
#      help .dbxrc >$HOME/.dbxrc
# to create it with these contents.  Or, to enable a useful set of options, use
#      help .dbxrc | sed 's/^##/  /' >$HOME/.dbxrc
# In either case, you should then
#      source $HOME/.dbxrc
# (This last step is necessary only once.  Your .dbxrc file will be read
# automatically if it exists when dbx is invoked.)

# Note: The .dbxrc file uses KornShell syntax; old-style dbx aliases will not
# work in a .dbxrc file.  To convert your old .dbxinit file:
#           append the contents of your .dbxinit to your .dbxrc,
#           remove (or rename) your .dbxinit file, and
#    either change   alias foo bar baz   to   dalias foo bar baz 
#    or     change   alias foo bar baz   to   alias foo="bar baz"
# If you routinely use both newer and older releases of dbx, you might
# wish to retain your .dbxinit file and add uses of new functionality to
# a .dbxrc file which `sources' your .dbxinit.  There is an example of
# how to do this at the end of this help topic.

#  set +o path              # uncomment this line to disable $PATH searching
## set -o ignoresuspend     # uncomment to cause dbx to ignore ^Z
set -o emacs             # uncomment to enable emacs-style command editing
#  set -o vi                #   or uncomment this line for vi-style editing
## dbxenv output_short_file_name on  # print short pathnames for files
## dbxenv scope_look_aside on # find file static symbols even when not in scope
## dbxenv output_dynamic_type on  # cause `-d' to be the default for printing,
                                  #   displaying, and inspecting (C++)
#  dbxenv stack_verbose off # suppress printing of arguments and line numbers
                            #   in `where' (improves performance)
## button ignore step up    # add `step up' button to GUI


dbxenv suppress_startup_message 4.0
dbxenv suppress_startup_message 5.0
#pathmap /home/shavirin/internal/blast/BlastQueue/Web
#pathmap /home/shavirin/ncbi/FormatDB
pathmap /home/shavirin/WWW/blast/Src
pathmap /netopt/ncbi_tools/ver0.0/ncbi/altsrc

# Uncomment the following two lines to enable dbx journaling.
# This can help Sun support personnel diagnose bugs in the field.
#  import /opt/SUNWspro/lib/debugging.so >/dev/null
#  log -default -start

# some useful aliases
## kalias alias=kalias      # ensure that KSH alias syntax is used
## alias n=next
## alias N=nexti
## alias s=step
## alias S=stepi
## alias su="step up"
## alias c=cont
## alias p=print
## alias q=quit
## alias w=where
## alias si="stop in"
## alias sa="stop at"
## alias sm="stop modify"
## alias sr="stop returns"
## alias sif="stop infunction"
## alias sim="stop inmember"
## alias sic="stop inclass"
## alias en="handler -enable"
## alias di="handler -disable"
## alias wi=whatis
## alias l=list
## alias u=up
## alias d=down
## alias h=history
## alias f=frame
## alias goto="stop at !:1 -temp; cont"
## button lineno goto

# some useful functions

## function hex    # print arg in hex
## {
##     : ${1?"usage: $0 <expr>  # print <expr> in hex"}
##     typeset -i16 x
##     ((x = $[(int)$*]))
##     echo - $* = $x
## }
## typeset -q hex

## function pp # print pointer; print expression as symbolic
## {           # address and hex value
##     : ${1?"usage: $0 <expr> # print expr as symbolic address and hex value"}
##     builtin examine $[(int)$*]/X
## }
## typeset -q pp

## function regs   # print all registers and disassemble current instruction
## {
##     [ -z "$1" ] || { echo "$0: unexpected argument" >&2 && return; }
##     typeset -i16 off
##     pcval=$[$pc]
##     echo \$sp = $[$sp]
##     echo \$fp = $[$fp]
##     echo -n \$pc = $pcval"\t"
##     builtin examine $pc/i
##     builtin examine &$g0/32X
## }

## function offsetof  # print offset of $2 in type $1: offsetof strct fld
## {
##     : ${2?"usage: $0 <structname> <fieldname>  # offset of fld in struct"}
##     [ -z "$3" ] || { echo "$0: unexpected argument" >&2 && return; }
##     echo - $[(int)(&((($1*)0)->$2))]
## }
## alias off=offsetof

## function environment  # dump the environment variables of the target process
## {
##     [ -z "$1" ] || { echo "$0: unexpected argument" >&2 && return; }
##     typeset -i i=0
##     typeset env="((char **)$[(char**)environ])"
##     while :
##     do
##         x=$[($env)[$i]]
##         echo "$i: " "${x#0x*\ }"
##         case "$x" in
##         *\(nil\)*)    break;;
##         esac
##         ((i += 1))
##     done
## }

## function hexdump         # dump $2 (default: sizeof $1) bytes in hex
## {
##     : ${1?"usage: $0 <exp> [<size>]  # dump <size> bytes in hex"}
##     typeset -i16 p="$[(void *)&$1]"                     # address of $1
##     typeset -i s="${2:-$[sizeof ($1)]}" >/dev/null 2>&1 # number of bytes
## 
##     builtin examine $p/$[(${s:-4}+3)/4]X
## }
## typeset -q hexdump

## alias hd=hexdump

## button expand hexdump        # uncomment to install debugger button

## if $havegui
## then
##     SMSO=                    # can't use reverse video in GUI
##     RMSO=
## else
##     SMSO=$(tput smso)        # start standout mode (reverse video)
##     RMSO=$(tput rmso)        # end standout mode
## fi

## function win     # print window of 10 lines around $1 (or $vlineno)
## {
##     typeset -i first=0 last=0
##     typeset -i v=${1:-$vlineno}
##     case "$v" in
##     0)      first=1; v=1 ;;
##     [1-5])  first=1 ;;
##     *)      ((first = v - 5)) ;;
##     esac
##     ((last = first + 10))
##     list $first $[$v-1]
##     echo -n "${SMSO:->}"
##     list $v 
##     echo -n "$RMSO"
##     list $[$v+1] $last
## }

## PS1="$SMSO(dbx !)$RMSO " # reverse-video prompt with history number

# Here is an example of the _cb_prompt callback routine.
# See `help callbacks' for more details.

# function _cb_prompt
# {
#     if $mtfeatures
#     then    # set prompt for MT debugging
#             PS1='${SMSO}${thread} ${lwp} <!>${RMSO} '
#     else    # set prompt for non-thread debugging
#             PS1='${SMSO}dbx<!>${RMSO} '
#     fi
# }

# Read in the existing .dbxinit file, if any.  Assume that old-style aliases
# may be found, so we must temporarily redefine `alias'.

kalias alias=dalias
if   [ -r   .dbxinit ]
then source .dbxinit
elif [ -r   $HOME/.dbxinit ]
then source $HOME/.dbxinit
fi
kalias alias=kalias


