Reputation: 35598
I'm trying to debug an application build with the NDK on a Motorola Droid. I'm following the instructions here and I've had success in the past on an emulator (I have root access obviously) but when I try to start
gdbserver :5039 --attach 1082
through the adb shell, I get a gdbserver:permission denied
. Obviously as this is a stock Droid, I don't have root access. Is that necessary? Am I just missing something?
Thanks in advance!
Edit I have confirmed that this command works on the emulator. Can this be done on a nonrooted device?
Edit 2 I have also confirmed the same Permission Denied
errors on an EVO 4G.
Edit 3 I have also discovered that a production device (eg. EVO 4G or Droid) will not give me a "not found" error. For instance, when I typed something random like ljs
at the shell, I get ljs: permission denied
. The error is the same if the command exists and I can't access it (sudo - presumably) or if the command does not exist (ljs).
Upvotes: 5
Views: 1754
Reputation: 5525
If you're using the r4 NDK, you shouldn't have to do a lot of this. Instead:
Upvotes: 2
Reputation: 34592
I see no reference to 'localhost' as per
gdbserver :5039 --attach pid
in the link you've given - that is on the handset....have you forwarded the port
adb forward tcp:5039 tcp:5039
from the workstation?
Also:
If you can't find either special version of gdb, run find prebuilt -name arm-eabi-gdb in your source tree to find and run the latest version
Have you tried using 'arm-eabi-gdb' instead, by replacing the above gdb with the explicit version....?
Upvotes: 1