diff options
author | Yu Xiaolei <dreifachstein@gmail.com> | 2014-12-09 20:53:09 +0800 |
---|---|---|
committer | Yu Xiaolei <dreifachstein@gmail.com> | 2014-12-09 21:17:09 +0800 |
commit | e146cc1cc24f15ecae79cea41b1bd7e8c514654c (patch) | |
tree | 57f95a6bf248e0370483ffbe9b2cc0869557445b | |
parent | e505b304e02af3423a69735bb86fd1288a3641b4 (diff) | |
download | ndk-e146cc1cc24f15ecae79cea41b1bd7e8c514654c.tar.gz |
ndk-gdb: add a command-line switch to allow overriding of package name
This is useful when native librares are built inside library projects.
Change-Id: Iac4a210a3a3aeb879e2729d0396ad5a42013508d
-rwxr-xr-x | ndk-gdb | 24 |
1 files changed, 17 insertions, 7 deletions
@@ -99,6 +99,7 @@ OPTION_LAUNCH= OPTION_LAUNCH_LIST=no OPTION_DELAY= OPTION_WAIT="-D" +OPTION_PACKAGE_NAME= check_parameter () { @@ -262,6 +263,9 @@ while [ -n "$1" ]; do JDB_PORT= OPTION_WAIT= ;; + --package=*) + OPTION_PACKAGE_NAME="$optarg" + ;; -*) # unknown options echo "ERROR: Unknown option '$opt', use --help for list of valid ones." exit 1 @@ -305,6 +309,7 @@ if [ "$OPTION_HELP" = "yes" ] ; then echo " --delay=<secs> Delay in seconds between activity start and gdbserver attach." echo " --project=<path> Specify application project path" echo " -p <path> Same as --project=<path>" + echo " --package=<name> Specify package name" echo " --port=<port> Use tcp:localhost:<port> to communicate with gdbserver [$DEBUG_PORT]" echo " --exec=<file> Execute gdb initialization commands in <file> after connection" echo " -x <file> Same as --exec=<file>" @@ -482,13 +487,18 @@ else log "Using auto-detected project path: $PROJECT" fi -# Extract the package name from the manifest -PACKAGE_NAME=`run_awk_manifest_script extract-package-name.awk` -log "Found package name: $PACKAGE_NAME" -if [ $? != 0 -o "$PACKAGE_NAME" = "<none>" ] ; then - echo "ERROR: Could not extract package name from $PROJECT/$MANIFEST." - echo " Please check that the file is well-formed!" - exit 1 +if [ ! -z "$OPTION_PACKAGE_NAME" ]; then + PACKAGE_NAME="$OPTION_PACKAGE_NAME" + log "Using package name: $PACKAGE_NAME" +else + # Extract the package name from the manifest + PACKAGE_NAME=`run_awk_manifest_script extract-package-name.awk` + log "Found package name: $PACKAGE_NAME" + if [ $? != 0 -o "$PACKAGE_NAME" = "<none>" ] ; then + echo "ERROR: Could not extract package name from $PROJECT/$MANIFEST." + echo " Please check that the file is well-formed!" + exit 1 + fi fi # If --launch-list is used, list all launchable activities, and be done with it |