diff options
author | Steve Kondik <steve@cyngn.com> | 2015-12-03 13:34:59 -0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-12-03 13:34:59 -0800 |
commit | c35fae7fa869b6dc3554bdbb1519a9f328363699 (patch) | |
tree | fa5fb8d5a052a66cee725448e0b0413b748a0c67 | |
parent | ad02348c05b1b8badb3ca57fbd2156115c8620e3 (diff) | |
download | android_development-c35fae7fa869b6dc3554bdbb1519a9f328363699.tar.gz android_development-c35fae7fa869b6dc3554bdbb1519a9f328363699.tar.bz2 android_development-c35fae7fa869b6dc3554bdbb1519a9f328363699.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 b74a8f01e..acfb9c7be 100755 --- a/scripts/gdbclient +++ b/scripts/gdbclient @@ -47,15 +47,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) @@ -63,6 +54,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 OUT_ROOT="$ROOT/out/target/product/$DEVICE" local SYMBOLS_DIR="$OUT_ROOT/symbols" local IS_TAPAS_USER="$(get_build_var TARGET_BUILD_APPS)" |