I am looking to build a debugger using java debug interface.
My objective is to set a breakpoint and get the value of a variable.
I found this answer close to what
To answer question about interfaces, here is quick explanation.
Virtual Machine (VM) - JVM which is running debug target program.
Connector - This connects debugger program to JVM of debug target. LaunchingConnector which will launch a JVM & connect to it. There are also AttachingConnector which connect to existing running JVM.
Events - When VM runs debug target program in debug mode, it triggers several events so that debugger program can take action as needed. Debugger program can also request VM to trigger certain special events which are not triggered by default.
To answer break point part of question, here is a snippet.
Location location = classType.locationsOfLine(lineNumberToPutBreakpoint).get(0);
BreakpointRequest bpReq = vm.eventRequestManager().createBreakpointRequest(location);
bpReq.enable();
This article has complete simple Hello World example with further explanation. Might find useful to get started with basic understanding.