Search in sources :

Example 1 with PerlLineBreakpointProperties

use of com.perl5.lang.perl.idea.run.debugger.breakpoints.PerlLineBreakpointProperties in project Perl5-IDEA by Camelcade.

the class PerlDebugProcess method stop.

@Override
public void stop() {
    myDebugThread.setStop();
    ApplicationManager.getApplication().runReadAction(() -> {
        XBreakpointManager breakpointManager = XDebuggerManager.getInstance(getSession().getProject()).getBreakpointManager();
        Collection<? extends XLineBreakpoint<PerlLineBreakpointProperties>> breakpoints = breakpointManager.getBreakpoints(PerlLineBreakpointType.class);
        for (XLineBreakpoint<PerlLineBreakpointProperties> breakpoint : breakpoints) {
            breakpointManager.updateBreakpointPresentation(breakpoint, null, null);
        }
    });
}
Also used : XBreakpointManager(com.intellij.xdebugger.breakpoints.XBreakpointManager) PerlLineBreakpointProperties(com.perl5.lang.perl.idea.run.debugger.breakpoints.PerlLineBreakpointProperties)

Example 2 with PerlLineBreakpointProperties

use of com.perl5.lang.perl.idea.run.debugger.breakpoints.PerlLineBreakpointProperties in project Perl5-IDEA by Camelcade.

the class PerlDebugUtil method findBreakpoint.

@Nullable
public static XLineBreakpoint findBreakpoint(final Project project, final PerlDebuggingEventBreakpoint breakpointBase) {
    final XLineBreakpoint[] result = new XLineBreakpoint[] { null };
    ApplicationManager.getApplication().runReadAction(() -> {
        String path = breakpointBase.getPath();
        VirtualFile virtualFile;
        String virtualFileUrl;
        virtualFile = VfsUtil.findFileByIoFile(new File(breakpointBase.getDebugThread().getDebugProfileState().mapPathToLocal(path)), true);
        if (virtualFile == null) {
            virtualFileUrl = PerlRemoteFileSystem.PROTOCOL_PREFIX + path;
        } else {
            virtualFileUrl = virtualFile.getUrl();
        }
        Collection<? extends XLineBreakpoint<PerlLineBreakpointProperties>> breakpoints = XDebuggerManager.getInstance(project).getBreakpointManager().getBreakpoints(PerlLineBreakpointType.class);
        for (XLineBreakpoint<PerlLineBreakpointProperties> breakpoint : breakpoints) {
            if (StringUtil.equals(breakpoint.getFileUrl(), virtualFileUrl) && breakpoint.getLine() == breakpointBase.getLine()) {
                result[0] = breakpoint;
                return;
            }
        }
    });
    return result[0];
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File) PerlLineBreakpointProperties(com.perl5.lang.perl.idea.run.debugger.breakpoints.PerlLineBreakpointProperties) XLineBreakpoint(com.intellij.xdebugger.breakpoints.XLineBreakpoint) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

PerlLineBreakpointProperties (com.perl5.lang.perl.idea.run.debugger.breakpoints.PerlLineBreakpointProperties)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 XBreakpointManager (com.intellij.xdebugger.breakpoints.XBreakpointManager)1 XLineBreakpoint (com.intellij.xdebugger.breakpoints.XLineBreakpoint)1 File (java.io.File)1 Nullable (org.jetbrains.annotations.Nullable)1