Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ndk-gdb from NDK r11c for Windows x64 can't start the debugging session - it just outputs ERROR: Failed to find running process 'com.example.native_activity' #63

Closed
dosvidos opened this issue Apr 1, 2016 · 3 comments
Assignees

Comments

@dosvidos
Copy link

dosvidos commented Apr 1, 2016

I've tried to debug the native-activity NDK sample with ndk-gdb script on Nexus 9 running API23 with February 2016 security updates - the script fails to start the default activity if a package process is not running on the device:

f:\work\android-ndk-r11c\ndk-gdb.cmd -v
ADB command used: 'adb -s HT4AHJT08522'
ADB version: Android Debug Bridge version 1.0.32 Revision 09a0d98bebce-android
Using project directory: c:\wrk\android\android-ndk-samples\native-activity
Found package name: com.example.native_activity
Attaching to existing application process.
Application ABIs: arm64-v8a, armeabi, armeabi-v7a, armeabi-v7a-hard, mips, mips64, x86, x86_64
Device ABIs: arm64-v8a, armeabi-v7a, armeabi
Selecting ABI: arm64-v8a
Detected pretty printer: none
Found application data directory: /data/data/com.example.native_activity
App gdbserver not found at /data/data/com.example.native_activity/lib/gdbserver, uploading.
Copying gdbserver to /data/data/com.example.native_activity/arm64-gdbserver.
Uploaded gdbserver to /data/data/com.example.native_activity/arm64-gdbserver
ERROR: Failed to find running process 'com.example.native_activity'

--delay option makes no difference, maybe it's not working at all:

f:\work\android-ndk-r11c\ndk-gdb.cmd -v --delay 3.0
ADB command used: 'adb -s HT4AHJT08522'
ADB version: Android Debug Bridge version 1.0.32 Revision 09a0d98bebce-android
Using project directory: c:\wrk\android\android-ndk-samples\native-activity
Found package name: com.example.native_activity
Attaching to existing application process.
Application ABIs: arm64-v8a, armeabi, armeabi-v7a, armeabi-v7a-hard, mips, mips64, x86, x86_64
Device ABIs: arm64-v8a, armeabi-v7a, armeabi
Selecting ABI: arm64-v8a
Detected pretty printer: none
Found application data directory: /data/data/com.example.native_activity
App gdbserver not found at /data/data/com.example.native_activity/lib/gdbserver, uploading.
Copying gdbserver to /data/data/com.example.native_activity/arm64-gdbserver.
Uploaded gdbserver to /data/data/com.example.native_activity/arm64-gdbserver
ERROR: Failed to find running process 'com.example.native_activity'

After the process for package com.example.native_activity is created on the device - either by hand from Android launcher or by Activity Manager command adb shell am start ndk-gdb script works without a problem.

The issue is reproduced on other devices, too.
My Nexus 9 props:

[ro.bootimage.build.date]: [Fri Aug 28 18:07:58 UTC 2015]
[ro.bootimage.build.date.utc]: [1440785278]
[ro.bootimage.build.fingerprint]: [google/volantis/flounder:6.0/MRA58B/2214705:userdebug/dev-keys]
[ro.bootloader]: [3.48.0.0135]
[ro.bootmode]: [normal]
[ro.bt.bdaddr_path]: [/sys/module/flounder_bdaddress/parameters/bdaddress]
[ro.build.characteristics]: [tablet,nosdcard]
[ro.build.date]: [Fri Aug 28 18:01:50 UTC 2015]
[ro.build.date.utc]: [1440784910]
[ro.build.description]: [volantis-userdebug 6.0 MRA58B 2214705 dev-keys]
[ro.build.display.id]: [volantis-userdebug 6.0 MRA58B 2214705 dev-keys]
[ro.build.expect.bootloader]: [3.48.0.0135]
[ro.build.fingerprint]: [google/volantis/flounder:6.0/MRA58B/2214705:userdebug/dev-keys]
[ro.build.flavor]: [volantis-userdebug]
[ro.build.host]: [wpiu7.hot.corp.google.com]
[ro.build.id]: [MRA58B]
[ro.build.product]: [flounder]
[ro.build.tags]: [dev-keys]
[ro.build.type]: [userdebug]
[ro.build.user]: [android-build]
[ro.build.version.all_codenames]: [REL]
[ro.build.version.base_os]: []
[ro.build.version.codename]: [REL]
[ro.build.version.incremental]: [2214705]
[ro.build.version.preview_sdk]: [0]
[ro.build.version.release]: [6.0]
[ro.build.version.sdk]: [23]
[ro.build.version.security_patch]: [2015-09-01]
[ro.carrier]: [unknown]
[ro.com.android.dataroaming]: [false]
[ro.com.android.wifi-watchlist]: [GoogleGuest]
[ro.com.google.clientidbase]: [android-google]
[ro.com.widevine.cachesize]: [16777216]
[ro.config.alarm_alert]: [Oxygen.ogg]
[ro.config.notification_sound]: [Tethys.ogg]
[ro.config.ringtone]: [Girtab.ogg]
[ro.crypto.fs_crypto_blkdev]: [/dev/block/dm-2]
[ro.crypto.state]: [encrypted]
[ro.crypto.type]: [block]
[ro.dalvik.vm.native.bridge]: [0]
[ro.debuggable]: [1]
[ro.enable_boot_charger_mode]: [1]
[ro.error.receiver.system.apps]: [com.google.android.gms]
[ro.expect.recovery_id]: [0x69ebff8f7cdfc74fa12ca89f6e3ad6be7da66cba000000000000000000000000]
[ro.facelock.black_timeout]: [700]
[ro.facelock.det_timeout]: [1500]
[ro.facelock.est_max_time]: [500]
[ro.facelock.lively_timeout]: [2500]
[ro.facelock.rec_timeout]: [2500]
[ro.facelock.use_intro_anim]: [true]
[ro.frp.pst]: [/dev/block/platform/sdhci-tegra.3/by-name/PST]
[ro.hardware]: [flounder]
[ro.hardware.gps]: [bcm47521]
[ro.hwui.disable_scissor_opt]: [true]
[ro.hwui.drop_shadow_cache_size]: [6]
[ro.hwui.gradient_cache_size]: [1]
[ro.hwui.layer_cache_size]: [48]
[ro.hwui.path_cache_size]: [32]
[ro.hwui.r_buffer_cache_size]: [8]
[ro.hwui.text_large_cache_height]: [1024]
[ro.hwui.text_large_cache_width]: [2048]
[ro.hwui.text_small_cache_height]: [1024]
[ro.hwui.text_small_cache_width]: [1024]
[ro.hwui.texture_cache_flushrate]: [0.4]
[ro.hwui.texture_cache_size]: [72]
[ro.opengles.version]: [196609]
[ro.product.board]: [flounder]
[ro.product.brand]: [google]
[ro.product.cpu.abi]: [arm64-v8a]
[ro.product.cpu.abilist]: [arm64-v8a,armeabi-v7a,armeabi]
[ro.product.cpu.abilist32]: [armeabi-v7a,armeabi]
[ro.product.cpu.abilist64]: [arm64-v8a]
[ro.product.device]: [flounder]
[ro.product.locale]: [en-US]
[ro.product.manufacturer]: [htc]
[ro.product.model]: [Nexus 9]
[ro.product.name]: [volantis]
[ro.radio.noril]: [true]
[ro.recovery_id]: [0x69ebff8f7cdfc74fa12ca89f6e3ad6be7da66cba000000000000000000000000]
[ro.revision]: [0]
[ro.ril.def.agps.mode]: [1]
[ro.runtime.firstboot]: [1459154601632]
[ro.secure]: [1]
[ro.serialno]: [HT4AHJT08522]
[ro.setupwizard.enterprise_mode]: [1]
[ro.setupwizard.require_network]: [any]
[ro.sf.lcd_density]: [320]
[ro.url.legal]: [http://www.google.com/intl/%s/mobile/android/basic/phone-legal.html]
[ro.url.legal.android_privacy]: [http://www.google.com/intl/%s/mobile/android/basic/privacy.html]
[ro.vendor.build.date]: [Fri Aug 28 18:26:10 UTC 2015]
[ro.vendor.build.date.utc]: [1440786370]
[ro.vendor.build.fingerprint]: [google/volantis/flounder:6.0/MRA58B/2214705:userdebug/dev-keys]
[ro.wifi.channels]: []
[ro.zygote]: [zygote64_32]
[selinux.reload_policy]: [1]
[sendbug.preferred.domain]: [google.com]
[service.bootanim.exit]: [1]
[sys.boot_completed]: [1]
[sys.oem_unlock_allowed]: [0]
[sys.settings_global_version]: [2]
[sys.settings_secure_version]: [4]
[sys.sysctl.extra_free_kbytes]: [36864]
[sys.sysctl.tcp_def_init_rwnd]: [60]
[sys.usb.config]: [mtp,adb]
[sys.usb.ffs.ready]: [1]
[sys.usb.state]: [mtp,adb]
[vold.decrypt]: [trigger_restart_framework]
[vold.has_adoptable]: [0]
[vold.post_fs_data_done]: [1]
[wifi.interface]: [wlan0]
[wlan.driver.status]: [unloaded]

@dosvidos dosvidos changed the title ndk-gdb from NDK r11c can't start the debugging - it returns ERROR: Failed to find running process 'com.example.native_activity' ndk-gdb from NDK r11c for Windows x64 can't start the debugging session - it just outputs ERROR: Failed to find running process 'com.example.native_activity' Apr 1, 2016
@jmgao
Copy link
Contributor

jmgao commented Apr 12, 2016

the script fails to start the default activity if a package process is not running on the device:
ndk-gdb.cmd -v

If I understand correctly, this is working as intended. (although apparently undocumented after I added the optional arg to --attach). It works with --launch, right? (i.e. the bug is that --help makes it sound like --launch is the default)

@dosvidos
Copy link
Author

@jmgao

If I understand correctly, this is working as intended. (although apparently undocumented after I added the optional arg to --attach). It works with --launch, right? (i.e. the bug is that --help makes it sound like --launch is the default)

You're right, ndk-gdb.cmd -v --launch works like it should, but it's very confusing because the --launch switch is implied as the default one.

@jmgao
Copy link
Contributor

jmgao commented Apr 28, 2016

@jmgao jmgao closed this as completed Apr 28, 2016
miodragdinic pushed a commit to MIPS/ndk that referenced this issue Jan 12, 2017
Also clarify the usage text.

Bug: android/ndk#63
Change-Id: I05e1186549aa78a52a3a2cdb5bf2adffa81c213f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants