Browse Source

Add instructions for debugging on Android with gdb.

Android's official documentation seems to assume you're using the NDK
build system or Android Studio. I extracted this from one of their
scripts a while back. May as well put it somewhere we can easily find
it.

Change-Id: I259abc54e6935ab537956a7cbf9f80e924a60b7a
Reviewed-on: https://boringssl-review.googlesource.com/c/34724
Reviewed-by: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
David Benjamin 5 years ago
committed by Adam Langley
parent
commit
9978f0a865
1 changed files with 15 additions and 0 deletions
  1. +15
    -0
      BUILDING.md

+ 15
- 0
BUILDING.md View File

@@ -106,6 +106,21 @@ higher to build aarch64 binaries.


For other options, see the documentation in the toolchain file. For other options, see the documentation in the toolchain file.


To debug the resulting binaries on an Android device with `gdb`, run the
commands below. Replace `ARCH` with the architecture of the target device, e.g.
`arm` or `arm64`.

adb push ${ANDROID_NDK}/prebuilt/android-ARCH/gdbserver/gdbserver \
/data/local/tmp
adb forward tcp:5039 tcp:5039
adb shell /data/local/tmp/gdbserver :5039 /path/on/device/to/binary

Then run the following in a separate shell. Replace `HOST` with the OS and
architecture of the host machine, e.g. `linux-x86_64`.

${ANDROID_NDK}/prebuilt/HOST/bin/gdb
target remote :5039 # in gdb

### Building for iOS ### Building for iOS


To build for iOS, pass `-DCMAKE_OSX_SYSROOT=iphoneos` and To build for iOS, pass `-DCMAKE_OSX_SYSROOT=iphoneos` and


Loading…
Cancel
Save