I
I
IvaToa102019-10-28 12:10:28
Java
IvaToa10, 2019-10-28 12:10:28

How to run native debugger in Android Studio?

Good afternoon!

There is an android application written by me that connects to a jni library that was not written by me and I do not have its source codes.
An error occurs there, and in order to identify it, it is necessary, as I understand it, to use gdb.
Only I have never used gdb and have questions.

I read this post - https://habr.com/en/post/151192/

It says, you need to run the command:

gdbserver :5039 --attach %PID%

I execute (after launching the application via the Debug 'app' button), (my pid, as shown by Android Studio, 15139):

gdbserver :5039 --attach 15139

Returns an error:

Attach to process failed (error 87): ╧рЁрьхЄЁ чрфрэ эхтхЁэю.


If you go to the gdb-console, and then execute the command, attach 15139, writes:

Can't attach to process.

What should I do?
Tried to put breakpoint, clean - the same result.

I also looked at the official article on Android - https://source.android.com/devices/tech/debug/gdb
It says, first you need to configure enviroment (envsetup.sh) and then execute (gdbclient.py).

Only I don't have them, in my Android NDK folder, where do I get them from?
My NDK version is r14b.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vanyamba-electronics, 2019-10-28
@vanyamba-electronics

sudo gdbserver :5039 --attach %PID%

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question