if (breakpoint.isEnabled()) {
fLastcmd = "breakpointAdded"; //$NON-NLS-1$
PHPLineBreakpoint bp = (PHPLineBreakpoint) breakpoint;
IMarker marker = bp.getMarker();
Breakpoint runtimeBreakpoint = bp.getRuntimeBreakpoint();
int lineNumber = runtimeBreakpoint.getLineNumber();
String fileName = null;
if (breakpoint instanceof PHPRunToLineBreakpoint) {
PHPRunToLineBreakpoint rtl = (PHPRunToLineBreakpoint) breakpoint;
IResource resource = rtl.getSourceFile();
fileName = resource.getFullPath().toString();
} else {
lineNumber = marker
.getAttribute(IMarker.LINE_NUMBER, 0);
runtimeBreakpoint.setLineNumber(lineNumber);
}
if (fileName == null) {
fileName = (String) marker
.getAttribute(
StructuredResourceMarkerAnnotationModel.SECONDARY_ID_KEY,
(String) marker
.getAttribute(IMarker.LOCATION));
IPath localPath = EnvironmentPathUtils
.getLocalPath(Path.fromPortableString(fileName));
fileName = localPath.toString();
}
fileName = RemoteDebugger.convertToRemoteFilename(fileName,
this);
runtimeBreakpoint.setFileName(fileName);
Logger.debugMSG("PHPDebugTarget: Setting Breakpoint - File " //$NON-NLS-1$
+ fileName + " Line Number " + lineNumber); //$NON-NLS-1$
debugger.addBreakpoint(bp.getRuntimeBreakpoint(),
fBreakpointAddedResponseHandler);
}