Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipse-dev] programmatically setting breakpoint using JDIDebugmodel interface

Title: programmatically setting breakpoint using JDIDebugmodel interface

Hi everybody,

In order to programmatically create a breakpoint at a given line of a file,
I have writen the following method :

it works nearly fine except that :

1) when in the Eclipse IDE, in the breakpoint view, I right click on a
breakpoint (that I have set with this method),
the "Go to file" item doesn't work whereas the marker is well created.
2) when editing the breakpoint property of a breakpoint that I have set
programmatically, the field "Member" DOESN'T appear in the property window.
(whereas it appears with a breakpoint created with the GUI).

I really appreciate any help.



Thanks

Olivier Roques

public void createBreakPoint(String filePath, String fullClassName, int
lineNumber) {

try {


System.out.println("********************** BEGIN *****************
CREATEBREAKPOINT*********************");

IFile aFile = getResourceFile(filePath);

if (lineBreakpointExists(filePath, lineNumber) != true) {


IJavaLineBreakpoint bp =

JDIDebugModel.createLineBreakpoint(aFile, fullClassName, lineNumber, -1, -1,
0, true, null);


System.out.println("bp.getMarker() = "+ bp.getMarker());

bp.getMarker().setAttribute(IMarker.LINE_NUMBER,16);

System.out.println("bp.getMarker().getResource()"+bp.getMarker().getResource
().getName());


System.out.println("bp.getMarker() = "+ bp.getMarker());

System.out.println("BreakPoint set at line " + bp.getLineNumber());

System.out.println("********************** END *****************
CREATEBREAKPOINT*********************");

}

} catch (CoreException ce) {}

}


Back to the top