diff options
author | Christopher Ferris <cferris@google.com> | 2015-05-20 19:36:54 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2015-05-20 22:34:18 -0700 |
commit | 574922caa9927b6d1ce64ea52e098dc47eff1a8b (patch) | |
tree | e708f776e19068b0b1caaadfc972c5d361f57ebc | |
parent | a0de890405f7c354dd9c7d07f154d89d59a7c4dc (diff) | |
download | android_development-574922caa9927b6d1ce64ea52e098dc47eff1a8b.tar.gz android_development-574922caa9927b6d1ce64ea52e098dc47eff1a8b.tar.bz2 android_development-574922caa9927b6d1ce64ea52e098dc47eff1a8b.zip |
Add a conditional removal of \r\n from adb output.
Bug: 21338668
(cherry picked from commit 8981aee6a9b92058943f22b26e0996859b07d7a3)
Change-Id: I590d2e76e06b6ba277d7554a119d5351afab1b3f
-rwxr-xr-x | scripts/gdbclient | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/gdbclient b/scripts/gdbclient index 51139773c..b74a8f01e 100755 --- a/scripts/gdbclient +++ b/scripts/gdbclient @@ -13,16 +13,16 @@ fi source $ANDROID_BUILD_TOP/build/envsetup.sh function adb_get_product_device() { - local candidate=`adb shell getprop ro.product.device | sed s/.$//` + local candidate=`adb shell getprop ro.product.device | tr -d '\r\n'` if [ -z $candidate ]; then - candidate=`adb shell getprop ro.hardware | sed s/.$//` + candidate=`adb shell getprop ro.hardware | tr -d '\r\n'` fi echo $candidate } # returns 0 when process is not traced function adb_get_traced_by() { - echo `adb shell cat /proc/$1/status | grep -e "^TracerPid:" | sed "s/^TracerPid:\t//" | sed s/.$//` + echo `adb shell cat /proc/$1/status | grep -e "^TracerPid:" | sed "s/^TracerPid:\t//" | tr -d '\r\n'` } function get_symbols_directory() @@ -95,7 +95,7 @@ function gdbclient() { fi fi - local EXE=`adb shell readlink /proc/$PID/exe | sed s/.$//` + local EXE=`adb shell readlink /proc/$PID/exe | tr -d '\r\n'` if [ -z "$EXE" ]; then echo "Error: no such pid=$PID - is process still alive?" @@ -126,7 +126,7 @@ function gdbclient() { local GDB= local GDB64= - local CPU_ABI=`adb shell getprop ro.product.cpu.abilist | sed s/.$//` + local CPU_ABI=`adb shell getprop ro.product.cpu.abilist | tr -d '\r\n'` # TODO: Derive this differently to correctly support multi-arch. We could try to parse # /proc/pid/exe. Right now, we prefer 64bit by checking those entries first. # TODO: Correctly support native bridge, which makes parsing abilist very brittle. |