gdb on chromium for android

488 views
Skip to first unread message

Stefan Zager

unread,
Oct 1, 2019, 4:16:58 PM10/1/19
to Chromium-dev
Hello,

I'm trying to debug chromium on android by following these instructions:
https://chromium.googlesource.com/chromium/src/+/master/docs/android_debugging_instructions.md#debugging-c_c

... but having trouble:

$ out/Debug/bin/chrome_public_apk gdb --pid <renderer PID>
W    0.455s Main  Running: $CHROMIUM_SRC/build/android/adb_gdb --package-name=org.chromium.chrome --output-directory=$CHROMIUM_SRC/out/Android-Debug --adb=$CHROMIUM_SRC/third_party/android_sdk/public/platform-tools/adb --device=712KPZK1085669 --pid=30607 --port=5039 --target-arch=arm
All subsequent output is from adb_gdb script.
ERROR: Cannot find Android NDK toolchain for 'arm' architecture. Please verify your NDK installation!
Extracting system libraries into: /tmp/adb-gdb-support-szager/712KPZK1085669-
ERROR: Could not list process's memory mappings.
ERROR: Use --su-prefix if the application is not debuggable.


I hacked around this by applying this patch:

diff --git a/build/android/adb_gdb b/build/android/adb_gdb
index 1dc3ce5f3bc9..65091df0a301 100755
--- a/build/android/adb_gdb
+++ b/build/android/adb_gdb
@@ -98 +98 @@ TARGET_ARCH=
-TOOLCHAIN=
+TOOLCHAIN=$CHROMIUM_SRC/third_party/android_ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin


... but now I get a different problem:

$ out/Debug/bin/chrome_public_apk gdb --pid <renderer PID>
W    0.456s Main  Running: $CHROMIUM_SRC/build/android/adb_gdb --package-name=org.chromium.chrome --output-directory=$CHROMIUM_SRC/out/Android-Debug --adb=$CHROMIUM_SRC/third_party/android_sdk/public/platform-tools/adb --device=712KPZK1085669 --pid=30607 --port=5039 --target-arch=arm
All subsequent output is from adb_gdb script.
Extracting system libraries into: /tmp/adb-gdb-support-szager/712KPZK1085669-
ERROR: Could not list process's memory mappings.
ERROR: Use --su-prefix if the application is not debuggable.


Any help will be greatly appreciated.

Robert Sesek

unread,
Dec 5, 2019, 11:28:12 AM12/5/19
to Stefan Zager, Chromium-dev
Hi Stefan,

I was trying to use chrome_public_apk today as well but ran into similar issues. Did you ever find a resolution?

- Robert

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAHOQ7J9AzphXF4Hs2rPoagVE54MQmM8y_EMWW7Lu8RPOt-OGsA%40mail.gmail.com.

Stefan Zager

unread,
Dec 5, 2019, 7:10:25 PM12/5/19
to Robert Sesek, Chromium-dev
I did eventually get it working, although I don't remember exactly how I fixed that issue. I think it might have been adding this to args.gn:

android_full_debug = true

I discovered that flag by combing through the output of `gn args --list`.

Hope that helps!


Reply all
Reply to author
Forward
0 new messages