mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 23:05:47 +02:00
Bug 438310 - Add --help option to cdtdebug.sh
- do some parsing of options in cdtdebug script - allow all options after -e executable to be passed to main and not processed by Eclipse (e.g. -clean) - prohibit -vmargs option from being used Change-Id: Id40044a3dc9170f57c848447793dfa9aa044d60e Reviewed-on: https://git.eclipse.org/r/29494 Tested-by: Hudson CI Reviewed-by: Jeff Johnston <jjohnstn@redhat.com> Tested-by: Jeff Johnston <jjohnstn@redhat.com>
This commit is contained in:
parent
e5f667c97e
commit
92c9224591
1 changed files with 66 additions and 2 deletions
|
@ -9,25 +9,89 @@
|
||||||
# Contributors:
|
# Contributors:
|
||||||
# Red Hat Inc. - initial API and implementation
|
# Red Hat Inc. - initial API and implementation
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
usage="\
|
||||||
|
Usage: $0 [ECLIPSE_OPTIONS] [-b BUILD_LOG] [TARGET_OPTION]
|
||||||
|
|
||||||
|
Debug an executable, core-file, or an existing process using the Eclipse
|
||||||
|
C/C++ Stand-alone Debugger. Eclipse command-line options may be passed
|
||||||
|
except for -vmargs which is being used to start up the Eclipse Debugger.
|
||||||
|
|
||||||
|
Operation modes:
|
||||||
|
-h, --help print this help, then exit
|
||||||
|
|
||||||
|
Indexing assist options:
|
||||||
|
-b BUILD_LOG build log to use for compiler includes/flags
|
||||||
|
|
||||||
|
Target options:
|
||||||
|
-a attach to an existing process (list will be shown)
|
||||||
|
-c COREFILE debug core-file (should also specify executable)
|
||||||
|
-e EXECUTABLE [ARGS...] debug given executable (passing ARGS to main)
|
||||||
|
|
||||||
|
The -e option must be used last as subsequent options are passed to main.
|
||||||
|
|
||||||
|
Specifying insufficient arguments for a particular target will result in a
|
||||||
|
dialog displayed to enter the required values for that target. Specifying
|
||||||
|
no target option brings up a dialog for debugging an executable with the
|
||||||
|
executable path, program arguments, and build log filled in from the last -e
|
||||||
|
invocation, if one exists.
|
||||||
|
|
||||||
|
Wiki page: <http://wiki.eclipse.org/CDT/StandaloneDebugger>"
|
||||||
|
|
||||||
|
exit_missing_arg='
|
||||||
|
echo $0": error: option [$1] requires an argument"; exit 1'
|
||||||
|
|
||||||
|
# Parse command line.
|
||||||
|
options=
|
||||||
|
while test $# -gt 0 ; do
|
||||||
|
case $1 in
|
||||||
|
--help | -h )
|
||||||
|
echo "$usage"; exit ;;
|
||||||
|
-vmargs )
|
||||||
|
echo $0": error: -vmargs option is prohibited"; exit 1;;
|
||||||
|
-e )
|
||||||
|
test $# = 1 && eval "$exit_missing_arg"
|
||||||
|
options="$options $1 $2"
|
||||||
|
shift; shift;
|
||||||
|
# Get all options after -e and protect them from being
|
||||||
|
# processed by Eclipse as Eclipse options
|
||||||
|
while test $# -gt 0; do
|
||||||
|
options="$options \"$1\""
|
||||||
|
shift;
|
||||||
|
done ;;
|
||||||
|
-c )
|
||||||
|
test $# = 1 && eval "$exit_missing_arg"
|
||||||
|
options="$options $1 $2"
|
||||||
|
shift; shift ;;
|
||||||
|
* )
|
||||||
|
options="$options $1"; shift ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# Make sure local directory exists and has contents initialized
|
||||||
if [ ! -d $HOME/cdtdebugger ]; then
|
if [ ! -d $HOME/cdtdebugger ]; then
|
||||||
mkdir -p $HOME/cdtdebugger
|
mkdir -p $HOME/cdtdebugger
|
||||||
cp config.ini $HOME/cdtdebugger
|
cp config.ini $HOME/cdtdebugger
|
||||||
cp dev.properties $HOME/cdtdebugger
|
cp dev.properties $HOME/cdtdebugger
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Calculate platform-specific jar file names
|
||||||
olddir=`pwd`
|
olddir=`pwd`
|
||||||
cd ../..
|
cd ../..
|
||||||
OSGI_JAR=`ls org.eclipse.osgi_*.jar`
|
OSGI_JAR=`ls org.eclipse.osgi_*.jar`
|
||||||
SWT_JAR=`ls org.eclipse.swt.*.jar`
|
SWT_JAR=`ls org.eclipse.swt.*.jar`
|
||||||
SWT_PLUGIN=`echo $SWT_JAR | sed -e "s/_[0-9]*\..*.jar//"`
|
SWT_PLUGIN=`echo $SWT_JAR | sed -e "s/_[0-9]*\..*.jar//"`
|
||||||
FS_JAR=`ls org.eclipse.core.filesystem.*.jar`
|
FS_JAR=`ls org.eclipse.core.filesystem.*.jar | grep -v java7`
|
||||||
FS_PLUGIN=`echo $FS_JAR | sed -e "s/_[0-9]*\..*.jar//"`
|
FS_PLUGIN=`echo $FS_JAR | sed -e "s/_[0-9]*\..*.jar//"`
|
||||||
LINUX_JAR=`ls org.eclipse.cdt.core.linux.*.jar`
|
LINUX_JAR=`ls org.eclipse.cdt.core.linux.*.jar`
|
||||||
LINUX_PLUGIN=`echo $LINUX_JAR | sed -e "s/_[0-9]*\..*.jar//"`
|
LINUX_PLUGIN=`echo $LINUX_JAR | sed -e "s/_[0-9]*\..*.jar//"`
|
||||||
cd ..; ECLIPSE_HOME=`pwd`
|
cd ..; ECLIPSE_HOME=`pwd`
|
||||||
cd $olddir
|
cd $olddir
|
||||||
|
|
||||||
|
# Run eclipse with the Stand-alone Debugger product specified
|
||||||
$ECLIPSE_HOME/eclipse -clean -product org.eclipse.cdt.debug.application.product \
|
$ECLIPSE_HOME/eclipse -clean -product org.eclipse.cdt.debug.application.product \
|
||||||
-data $HOME/workspace-cdtdebug -configuration file\:$HOME/cdtdebugger \
|
-data $HOME/workspace-cdtdebug -configuration file\:$HOME/cdtdebugger \
|
||||||
-dev file\:$HOME/cdtdebugger/dev.properties $@ \
|
-dev file\:$HOME/cdtdebugger/dev.properties $options \
|
||||||
-vmargs -Dosgi.jar=$OSGI_JAR -Dswt.plugin=$SWT_PLUGIN -Dfs.plugin=$FS_PLUGIN \
|
-vmargs -Dosgi.jar=$OSGI_JAR -Dswt.plugin=$SWT_PLUGIN -Dfs.plugin=$FS_PLUGIN \
|
||||||
-Dlinux.plugin=$LINUX_PLUGIN -Declipse.home=$ECLIPSE_HOME
|
-Dlinux.plugin=$LINUX_PLUGIN -Declipse.home=$ECLIPSE_HOME
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue