diff options
author | Steve Kondik <steve@cyngn.com> | 2015-12-03 13:34:59 -0800 |
---|---|---|
committer | Chirayu Desai <chirayudesai1@gmail.com> | 2016-08-28 00:04:45 +0530 |
commit | 3dd5f53c09d63aad800d8028df8a85e5e4fd4fc2 (patch) | |
tree | b3c40bf3cc1d302aa9279e0f78913489b588cf92 | |
parent | e2695f83fce806a3ea453a5a17fb1d5e49c5e90c (diff) | |
download | android_development-3dd5f53c09d63aad800d8028df8a85e5e4fd4fc2.tar.gz android_development-3dd5f53c09d63aad800d8028df8a85e5e4fd4fc2.tar.bz2 android_development-3dd5f53c09d63aad800d8028df8a85e5e4fd4fc2.zip |
gdbclient: Properly locate outdir on CM
Change-Id: I3b549ce7159af4169e61e42d738e9f86c18f8708
-rwxr-xr-x | scripts/gdbclient | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/scripts/gdbclient b/scripts/gdbclient index 19a6949fb..3d62dd405 100755 --- a/scripts/gdbclient +++ b/scripts/gdbclient @@ -49,15 +49,6 @@ function gdbclient() { fi local DEVICE=$(adb_get_product_device) - if [ -z "$DEVICE" ]; then - echo "Error: Unable to get device name. Please check if device is connected and ANDROID_SERIAL is set." - return -2 - fi - - if [ -n "$2" ]; then - PORT=$2 - fi - local ROOT=$(gettop) if [ -z "$ROOT" ]; then # This is for the situation with downloaded symbols (from the build server) @@ -65,6 +56,19 @@ function gdbclient() { ROOT=`realpath .` fi + + if [[ -z "$DEVICE" || ! -d "$ROOT/out/target/product/$DEVICE" ]]; then + if [ -z "$CM_BUILD" ]; then + echo "Error: Unable to get device name. Please check if device is connected and ANDROID_SERIAL is set." + return -2 + fi + DEVICE=$CM_BUILD + fi + + if [ -n "$2" ]; then + PORT=$2 + fi + local SYS_OUT_ROOT=$(get_build_var OUT_DIR) local OUT_ROOT="${SYS_OUT_ROOT:-${OUT_DIR:-$ROOT/out}}/target/product/$DEVICE" local SYMBOLS_DIR="$OUT_ROOT/symbols" |