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 --tui option is not working #64

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

Comments

@dosvidos
Copy link

dosvidos commented Apr 1, 2016

I've tried to debug the NDK sample native-activity with ndk-gdb script from NDK r11c for Windows 64-bit on Nexus 9 API23.
Script's option -t, --tui use GDB's tui mode seems to be broken - GDB window flashes on screen and instantly closes.

c:\wrk\android\android-ndk-samples\native-activity>f:\work\android-ndk-r11c\ndk-gdb.cmd -v -t
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
Pulling '/system/bin/app_process64' to 'c:\wrk\android\android-ndk-samples\native-activity\obj\local\arm64-v8a\system\bin\app_process64'
Pulling '/system/bin/linker64' to 'c:\wrk\android\android-ndk-samples\native-activity\obj\local\arm64-v8a\system\bin\linker64'
Pulling '/system/lib64/libc.so' to 'c:\wrk\android\android-ndk-samples\native-activity\obj\local\arm64-v8a\system\lib64\libc.so'
Pulling '/system/lib64/libm.so' to 'c:\wrk\android\android-ndk-samples\native-activity\obj\local\arm64-v8a\system\lib64\libm.so'
Pulling '/system/lib64/libdl.so' to 'c:\wrk\android\android-ndk-samples\native-activity\obj\local\arm64-v8a\system\lib64\libdl.so'
Starting gdbserver...
Redirecting gdbserver output to c:\users\mfilim~1\appdata\local\temp\gdbclient.log

c:\wrk\android\android-ndk-samples\native-activity>

@dosvidos dosvidos changed the title ndk-gdb from NDK r11c --tui is not working ndk-gdb from NDK r11c for Windows x64 --tui option is not working Apr 1, 2016
@nvidiamfilimonov
Copy link

nvidiamfilimonov commented Jun 10, 2016

Same story for NDK r12 for Windows x86-64 - gdb.exe process is started, it's window flashes for a second and instantly closes:

c:\wrk\android\android-ndk-samples\native-activity>f:\work\android-ndk-r12\ndk-gdb.cmd -v -t --launch android.app.NativeActivity
ADB command used: 'adb -s 015d24a8173c1e12'
ADB version: Android Debug Bridge version 1.0.35 Revision fc2a139a55f5-android
Using project directory: c:\wrk\android\android-ndk-samples\native-activity
Found package name: com.example.native_activity
Selected target activity: 'android.app.NativeActivity'
Application ABIs: arm64-v8a, armeabi, armeabi-v7a, mips, mips64, x86, x86_64
Device ABIs: armeabi-v7a, armeabi
Selecting ABI: armeabi-v7a
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.
Uploaded gdbserver to /data/local/tmp/arm-gdbserver
Launching activity com.example.native_activity/android.app.NativeActivity...
Sleeping for 0.25 seconds.
Pulling '/system/bin/linker' to 'c:\wrk\android\android-ndk-samples\native-activity\obj\local\armeabi-v7a\system\bin\linker'
Pulling '/system/lib/libc.so' to 'c:\wrk\android\android-ndk-samples\native-activity\obj\local\armeabi-v7a\system\lib\libc.so'
Pulling '/system/lib/libm.so' to 'c:\wrk\android\android-ndk-samples\native-activity\obj\local\armeabi-v7a\system\lib\libm.so'
Pulling '/system/lib/libdl.so' to 'c:\wrk\android\android-ndk-samples\native-activity\obj\local\armeabi-v7a\system\lib\libdl.so'
Starting gdbserver...
Redirecting gdbserver output to c:\users\mfilim~1\appdata\local\temp\gdbclient.log

gdbclient.log contains the single line:

run-as: exec failed for /data/local/tmp/arm-gdbserver Error:Permission denied

@jmgao
Copy link
Contributor

jmgao commented Jun 10, 2016

Sorry about the delay in responding to this, I've been focusing mostly on the unified headers stuff.

We currently don't build gdb with support for TUI on windows, because it depends on a curses implementation.

https://android-review.googlesource.com/#/c/238230/ to remove the option on windows

@jmgao jmgao closed this as completed Jun 10, 2016
miodragdinic pushed a commit to MIPS/ndk that referenced this issue Jan 12, 2017
gdb is compiled without support for TUI on Windows, because we don't
compile ncurses. Hide the flag in ndk-gdb.py until this changes.

Bug: android/ndk#64
Change-Id: Iedcb962a6df534cebfca69f110b2da1e3048d89a
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

3 participants