Is it possible to set breakpoints at a specific bytecode instruction?

折月煮酒 提交于 2019-12-24 17:15:38

问题


I'm using jdb to remotely debug a Java application of which I don't have the source code. Furthermore, the application jars are obfuscated.

I can set method breakpoints but, is it possible to set breakpoints at a specific bytecode instruction within a method? The idea I have is to use some disassembler like javap to identify the interesting instructions.

Can jdb or other Java debugger do this?


回答1:


You need line numbers to breakpoint on (something I assume has been removed). You can artificially add line numbers to the file using instrumentation and you will be able to breakpoint at every instruction if you wish.



来源:https://stackoverflow.com/questions/17979492/is-it-possible-to-set-breakpoints-at-a-specific-bytecode-instruction

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!