Merge "gdbclient: Improve error handling"

This commit is contained in:
Dmitriy Ivanov 2015-01-23 00:02:42 +00:00 committed by Gerrit Code Review
commit 23396bfc8d
1 changed files with 8 additions and 1 deletions

View File

@ -1041,11 +1041,18 @@ function gdbclient() {
if [ -z "$PID" ]; then if [ -z "$PID" ]; then
echo "Error: couldn't resolve pid by process name: $PROCESS_NAME" echo "Error: couldn't resolve pid by process name: $PROCESS_NAME"
return -4 return -4
else
echo "Resolved pid for $PROCESS_NAME is $PID"
fi fi
fi fi
local EXE=`adb shell readlink /proc/$PID/exe | sed s/.$//` local EXE=`adb shell readlink /proc/$PID/exe | sed s/.$//`
# TODO: print error in case there is no such pid
if [ -z "$EXE" ]; then
echo "Error: no such pid=$PID - is process still alive?"
return -4
fi
local LOCAL_EXE_PATH=$SYMBOLS_DIR$EXE local LOCAL_EXE_PATH=$SYMBOLS_DIR$EXE
if [ ! -f $LOCAL_EXE_PATH ]; then if [ ! -f $LOCAL_EXE_PATH ]; then