-1

I'm trying to use Breakpoints in Eclipse, but when I set them - nothing happens. Really. For example in MVS when the program reachs breakpoint it stopps and I can see variables.

How to use breakpoints in Eclipse in the same way?

146 percent Russian
  • 2,016
  • 2
  • 14
  • 20

2 Answers2

5

you need to be debugging the program, click the little bug next to the run button instead of said run button

ratchet freak
  • 47,288
  • 5
  • 68
  • 106
2

First select Debug perspective as:

enter image description here

Then set Breakpoints at places you want:

enter image description here

After that create a Debug configuration via Debug As->Debug Configurations... and then Debug as Android Application as shown below: enter image description here

Then in Debug perspective you can trace/watch value of your desired variable by pressing F8: enter image description here That's it, you can also evaluate expressions through Expressions view. If it is not enabled select it from: Window->Show View->Other->Debug->Expressions.

Imran Rana
  • 11,899
  • 7
  • 45
  • 51
  • You can use **Java** in place of **Android** as I just copied my own answer for doing this in Android [here](http://stackoverflow.com/questions/10531015/spy-watch-variable-in-android-eclipse/10532714#10532714) – Imran Rana May 13 '12 at 18:23
  • It would have been more appropriate to post a comment linking to the related answer directly instead of copy and pasting the same answer twice. – Flexo May 13 '12 at 21:00