Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse stepping into class in android

I have a simple android project that I am trying to debug inside of Eclipse. When I run it in debug mode and use the "Step Over" button, it frequently seems to want to go into Android code (I don't want it to do this, just as a C debugger will not go into libc). I get a screen that comes up which looks similar to:

Class File Editor

Source not found:

The JAR file blahblah/android.jar has no source attachment.
You can attach the source by clicking attach source 

I don't want it to go into Android or Dalvik code at all (even if I could install source code) I am only interested in my own personal code.

like image 987
Ryan Avatar asked Mar 19 '11 19:03

Ryan


2 Answers

not sure if it works for Android, but for Java SE you can set Step Filtering in the preferences to avoid stepping into some package/class:

Window -> Preferences -> Java -> Debug -> Step Filtering

Mark "Use Step Filters", add the packages and classes to ignore, mark "Step through filters".

enter image description here

Eventually you need to turn off the "Suspend execution on uncaught exceptions" to avoid the debugger stopping in case of an exception:

Window -> Preferences -> Java -> Debug
like image 110
user85421 Avatar answered Sep 21 '22 07:09

user85421


Depending on how you "step" you may be run through some platform/SDK code while moving between Activities even if your code seems to be running clean. To work around this I set a breakpoint somewhere within the next Activity and step through the current Activity and then once I hit the end of the code I hit resume and it breaks in my next Activity skipping any code that is not mine. Not the most elegant, but it works for me.

In Debug you will always be run through the exception handling platform..

like image 42
apesa Avatar answered Sep 20 '22 07:09

apesa