0

I project to build my own bytecodes debugger to view:

  • the currents "objects" in the operands stack;
  • to have a visual representation of frames;
  • to have a list of declared objects in the Java heap (of the running program);
  • to have a list of constant pools, etc

The problem is I want to set up in place a breakpoint options to my program and to see the application in real.

I looked on the internet the way to do a debugger, and I found JDPA wich could probably help me doing my project.

But, I am not sure its the good thing, cause I don't want a Java debugger, I really need a Bytecode debugger.

How can I insert bytecodes break points in a project ? I see on the internet that "0xca is reserved as a breakpoint instruction for debuggers and is not used by the language". Is it the good way ?

1 Answer 1

2

Option#1 : Using JPDA you can use com.sun.jdi.request.EventRequestManager.createBreakpointRequest() method you can add a breakpoint to any Location. Per the Java documentation on the Location class it is

A point within the executing code of the target VM.

It may be a bytecode location or the source line location.

Option#2: If you can find the method in which the bytecode lies you can place an artificial breakpoint in your JPDA-based debugger because you can tell the offset of the bytecode from the start of the function.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.