2

Ok, so I've been trying to debug Android apps from jdb.

I run the emulator, install the app, run ddms and then I launch the app and then select it in DDMS. Now I run jdb with the following command

jdb -attach localhost:8700 -sourcepath /project-root/src

jdb is able to attach to the process, and then a command such as

stop in com.android.helloworld.onClick

works well.

However, when I use C-x space in Emacs, it runs a command with the line number,

stop at com.android.helloworld:22

and I get this output

Unable to set breakpoint com.android.helloworld:22 : No code at line 22 in com.android.helloworld

I have checked that the line number is correct, and tried to pass the filename itself, to no avail. Any ideas?

spiffworks
  • 21
  • 2

1 Answers1

2

The Android SDK comes with an android.el that has the 'android-jdb' command in it. That will set up the keybindings correctly for you. (At least, I presume it will, I didn't try those keybindings last time I was using it.)

As a bonus, if you try out CEDET from the bzr trunk, it includes android support. After basic CEDET setup (see cedet.info for android details) it has a convenience for quickly starting up the debugger and attaching to your device with the debugger. It supports some other fun stuff too.

Eric
  • 3,959
  • 17
  • 15