Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting a breakpoint in bytecode

Tags:

java

As the title says: is it possible to set a breakpoint in classes with no source available? Does any debugger support this? Bonus points for being able to view the stack and local variables.

edit: Sorry for being unclear from start, but I'm not interested in method breakpoints. I want to set a breakpoint inside the method.

like image 493
Alexander Torstling Avatar asked Nov 01 '22 03:11

Alexander Torstling


1 Answers

If you are using eclipse, you can set breakpoints on the methods in the class using the outline view.

You can set a method breakpoint using the outline view of the class in question. Then the debugger breaks at the first line of the method.(taken from How to put breakpoint in class without having it's source?)

Right click on the method in eclipse outline view and select Toggle Method Breakpoint

P.S. I have tried this and it works for me.

like image 59
anirudh Avatar answered Nov 15 '22 04:11

anirudh