mdb.sh revision 7c478bd95313f5f23a4c958a745db2134aa03244
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright (c) 1998-2001 by Sun Microsystems, Inc.
# All rights reserved.
#
#ident "%Z%%M% %I% %E% SMI"
mdb_args= # Debugger argument string
#
# Attempt to locate a suitable mdb binary to execute, first on the local
# machine, then in the user's workspace, and finally on the MDB server.
# If we select the user's workspace, we also set $root to their proto area
# to force MDB to use shared libraries installed there as well.
#
break
fi
done
if [ -z "$mdb_exec" ]; then
echo "$0: cannot find mdb binary in ISA subdirectories" >& 2
exit 1
fi
fi
#
# Abort if we were not able to locate a copy of mdb to execute.
#
if [ -z "$mdb_exec" ]; then
echo "$0: failed to locate mdb executable" >& 2
exit 1
fi
#
# The wrapper script handles several special command-line arguments that are
# used to select a desired set of MDB macros, modules, and a libkvm binary.
#
if [ $# -gt 0 ]; then
case "$1" in
-s[0-9]*)
shift
;;
-[0-9]|-[0-9][0-9])
else
fi
shift
;;
shift
;;
-\?)
echo "Usage: $0" \
"[ -s<rel> | -s<bld> | -[0-9]+ | -B | -G | -U ] args ..."
echo "\t-s<rel> Use proto area for specified release"
echo "\t e.g. -${os_name}"
echo "\t-s<bld> Use proto area for specified build"
echo "\t e.g. -${os_name}_01"
echo "\t-[0-9]+ Use proto area for specified build of $os_name"
echo "\t-B Use proto area for $os_rel Beta build"
echo "\t-G Use proto area for $os_rel Generic build\n"
echo "\t-U Use proto area for $os_rel Beta_Update build"
;;
esac
fi
#
# If a build was specified, using the corresponding proto area from $mdb_lib.
# Note that this will override the $root setting determined above.
#
#
# If a proto area was set either by specifying a build number, or by using
# mdb from $CODEMGR_WS, set LD_LIBRARY_PATH accordingly. This allows mdb to
# pick up the appropriate libkvm.so to examine dumps from that build.
# We also add the -R flag to the mdb command line so that mdb will modify
# its default macro include and module library paths to use the build root.
#
echo "mdb: $root is missing or not a directory" >& 2
exit 1
fi
#
# We also need to set LD_LIBRARY_PATH if we're using mdb.eng's mdb
# binary -- it requires the new libproc.so to work properly.
#
LD_LIBRARY_PATH_64="$LD_LIBRARY_PATH_64$usrlib/sparcv9"
fi