开发者

jdb with android apps - unable to open source file

开发者 https://www.devze.com 2023-01-11 02:59 出处:网络
I am hoping to use jdb to debug android apps in the emulator via the ddms go between. I have successfully set a breakpoint in my class\' onCreate and the debugger (jdb) duly breaks. However if I try

I am hoping to use jdb to debug android apps in the emulator via the ddms go between.

I have successfully set a breakpoint in my class' onCreate and the debugger (jdb) duly breaks. However if I try to "list" the code it says it can not find the source file. I start jdb like this from emacs :-

jdb -sourcepath="~/programming/android/projects/myproj/src/net/richardriley/myproj" -attach localhost:8700

and I know for a fact that myact.java is there in that directory. I am a jdb newbie but isnt sourcepath t开发者_如何学Che way to deal with this? And if not what should I be doing?


I'm a JDB newbie myself and I finally figured out how to solve this problem.

You need to be in the src folder rather than right in the directory with the source files. That way JDB can follow the package name to find your source files (if I'm not mistaken).

So if you have a file ~/programming/android/projects/myproj/src/net/richardriley/myproj/SomeClass.java you would refer to it in JDB as net.richardriley.myproj.SomeClass and you would set your sourcepath to ~/programming/android/projects/myproj/src/

0

精彩评论

暂无评论...
验证码 换一张
取 消