am 09a4cac1: am 7cc3174d: Merge "Removed /system/bin prefix from gdbclient."

* commit '09a4cac12e3b040fb6d18490ff444b2fdd6cb451':
  Removed /system/bin prefix from gdbclient.
This commit is contained in:
Elliott Hughes 2014-06-18 00:55:33 +00:00 committed by Android Git Automerger
commit 1a03ddb805
1 changed files with 10 additions and 9 deletions

View File

@ -945,6 +945,11 @@ function gdbwrapper()
$GDB_CMD -x "$@"
}
function get_symbols_directory()
{
echo $(get_abs_build_var TARGET_OUT_UNSTRIPPED)
}
# process the symbolic link of /proc/$PID/exe and use the host file tool to
# determine whether it is a 32-bit or 64-bit executable. It returns "" or "64"
# which can be conveniently used as suffix.
@ -952,14 +957,9 @@ function is64bit()
{
local PID="$1"
if [ "$PID" ] ; then
local EXE=`adb shell ls -l /proc/$PID/exe \
| tr -d '\r' \
| cut -d'>' -f2 \
| tr -d ' ' \
| cut -d'/' -f4`
local OUT_EXE_SYMBOLS=$(get_abs_build_var TARGET_OUT_EXECUTABLES_UNSTRIPPED)
local IS64BIT=`file $OUT_EXE_SYMBOLS/$EXE | grep "64-bit"`
local EXE=`adb shell readlink /proc/$PID/exe`
local EXE_DIR=`get_abs_build_var PRODUCT_OUT`
local IS64BIT=`file "$EXE_DIR$EXE" | grep "64-bit"`
if [ "$IS64BIT" != "" ]; then
echo "64"
else
@ -979,7 +979,7 @@ function gdbclient()
local OUT_SYMBOLS=$(get_abs_build_var TARGET_OUT_UNSTRIPPED)
local OUT_SO_SYMBOLS=$(get_abs_build_var TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)
local OUT_VENDOR_SO_SYMBOLS=$(get_abs_build_var TARGET_OUT_VENDOR_SHARED_LIBRARIES_UNSTRIPPED)
local OUT_EXE_SYMBOLS=$(get_abs_build_var TARGET_OUT_EXECUTABLES_UNSTRIPPED)
local OUT_EXE_SYMBOLS=$(get_symbols_directory)
local PREBUILTS=$(get_abs_build_var ANDROID_PREBUILTS)
local ARCH=$(get_build_var TARGET_ARCH)
local GDB
@ -1059,6 +1059,7 @@ function gdbclient()
else
WHICH_GDB=$ANDROID_TOOLCHAIN_2ND_ARCH/$GDB
fi
gdbwrapper $WHICH_GDB "$OUT_ROOT/gdbclient.cmds" "$OUT_EXE_SYMBOLS/$EXE"
else
echo "Unable to determine build system output dir."