1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00
cdt/debug/org.eclipse.cdt.debug.application/scripts/cdtdebug.sh

106 lines
3.5 KiB
Bash
Raw Normal View History

#!/bin/bash
###############################################################################
Change standalone debugger to no longer limit number of bundles The maintenance of having a streamlined standalone debugger that starts as fast as possible is no longer possible. See for example #591 - therefore when using standalone debugger, use the same sets of plug-ins/features as the product it is installed in uses. The side effect is that the standalone debugger in this use case will start slower and extra "stuff" will be present in this UI. For people just building the standalone debugger, provide a minimum feature set. This will be many more bundles than before, but should still provide a reasonably small set that starts well. This simplification also includes removing the the duplicates set of CDT docs (debug/org.eclipse.cdt.debug.application.doc). These provided a simplified version of CDT's documentation targetted at just standalone debugger. However there are a few problems related to this duplication: - The two sets of docs were not kept in sync - The standalone docs appear in the online help, leading to duplicated entries - With the config.ini changes above, there is no way to exclude the main docs in the standalone case, so remove the duplicate A number of directly related clean-ups are included too: - Remove the `ConfigGenerator.java` that stopped being referenced in PR #761 - Complete the removal of `build-standalone-debugger-rcp` profile that was started in #761. There is a small drawback to not having this profile, the standalone debugger is very slow to build compared to the rest of CDT. If this becomes a problem, restoring this profile along with the changes made in #761 is reasonable. - bring debug.product's licenses up to date - modernize command line args to eclipse when using debug.product Fixes #781
2024-05-10 10:18:07 -04:00
# Copyright (c) 2014, 2024 Red Hat, Inc. and others
#
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat Inc. - initial API and implementation
# Marc Khouzam (Ericsson) - Update for remote debugging support (bug 450080)
###############################################################################
SCRIPT_DIR=`dirname $0`
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 [pid] attach using the optional pid or prompt for a pid
-c COREFILE debug core-file (should also specify executable)
-e EXECUTABLE [ARGS...] debug given executable (passing ARGS to main)
-r ADDRESS:PORT debug toward the specified remote server. Can be
combined with the -a option.
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.
More info: https://github.com/eclipse-cdt/cdt/blob/main/StandaloneDebugger.md"
exit_missing_arg='
echo $0": error: option [$1] requires an argument"; exit 1'
# Parse command line.
i=0
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[i]="$1"
let "i+=1"
options[i]="$2"
let "i+=1"
shift; shift;
# Get all options after -e and protect them from being
# processed by Eclipse as Eclipse options
while test $# -gt 0; do
options[i]=$1
let "i+=1"
shift;
done ;;
-c | -r )
test $# = 1 && eval "$exit_missing_arg"
options[i]="$1"
let "i+=1"
options[i]="$2"
let "i+=1"
shift; shift ;;
* )
options[i]="$1"; let "i+=1"; shift ;;
esac
done
# Make sure local directory exists and has contents initialized
if [ ! -d "$HOME/cdtdebugger" ]; then
/bin/sh "$SCRIPT_DIR/install.sh" || exit
fi
# Calculate platform-specific jar file names
ECLIPSE_HOME=$(cd "$SCRIPT_DIR/../../.." && pwd) # install.sh will modify this line. DO NOT REMOVE THE FOLLOWING MARKER: @#@#
ECLIPSE_EXEC="$ECLIPSE_HOME/eclipse"
# On macOS, the application layout is a bit different (Eclipse.app)
case $ECLIPSE_HOME in
*MacOS) ECLIPSE_HOME="$ECLIPSE_HOME/../Eclipse" ;;
esac
# Run eclipse with the Stand-alone Debugger product specified
Change standalone debugger to no longer limit number of bundles The maintenance of having a streamlined standalone debugger that starts as fast as possible is no longer possible. See for example #591 - therefore when using standalone debugger, use the same sets of plug-ins/features as the product it is installed in uses. The side effect is that the standalone debugger in this use case will start slower and extra "stuff" will be present in this UI. For people just building the standalone debugger, provide a minimum feature set. This will be many more bundles than before, but should still provide a reasonably small set that starts well. This simplification also includes removing the the duplicates set of CDT docs (debug/org.eclipse.cdt.debug.application.doc). These provided a simplified version of CDT's documentation targetted at just standalone debugger. However there are a few problems related to this duplication: - The two sets of docs were not kept in sync - The standalone docs appear in the online help, leading to duplicated entries - With the config.ini changes above, there is no way to exclude the main docs in the standalone case, so remove the duplicate A number of directly related clean-ups are included too: - Remove the `ConfigGenerator.java` that stopped being referenced in PR #761 - Complete the removal of `build-standalone-debugger-rcp` profile that was started in #761. There is a small drawback to not having this profile, the standalone debugger is very slow to build compared to the rest of CDT. If this becomes a problem, restoring this profile along with the changes made in #761 is reasonable. - bring debug.product's licenses up to date - modernize command line args to eclipse when using debug.product Fixes #781
2024-05-10 10:18:07 -04:00
"$ECLIPSE_EXEC" -clean \
-product org.eclipse.cdt.debug.application.product \
-application org.eclipse.cdt.debug.application.app \
Change standalone debugger to no longer limit number of bundles The maintenance of having a streamlined standalone debugger that starts as fast as possible is no longer possible. See for example #591 - therefore when using standalone debugger, use the same sets of plug-ins/features as the product it is installed in uses. The side effect is that the standalone debugger in this use case will start slower and extra "stuff" will be present in this UI. For people just building the standalone debugger, provide a minimum feature set. This will be many more bundles than before, but should still provide a reasonably small set that starts well. This simplification also includes removing the the duplicates set of CDT docs (debug/org.eclipse.cdt.debug.application.doc). These provided a simplified version of CDT's documentation targetted at just standalone debugger. However there are a few problems related to this duplication: - The two sets of docs were not kept in sync - The standalone docs appear in the online help, leading to duplicated entries - With the config.ini changes above, there is no way to exclude the main docs in the standalone case, so remove the duplicate A number of directly related clean-ups are included too: - Remove the `ConfigGenerator.java` that stopped being referenced in PR #761 - Complete the removal of `build-standalone-debugger-rcp` profile that was started in #761. There is a small drawback to not having this profile, the standalone debugger is very slow to build compared to the rest of CDT. If this becomes a problem, restoring this profile along with the changes made in #761 is reasonable. - bring debug.product's licenses up to date - modernize command line args to eclipse when using debug.product Fixes #781
2024-05-10 10:18:07 -04:00
-data "$HOME/workspace-cdtdebug" \
"${options[@]}"