Search in sources :

Example 6 with DebuggerManagerEx

use of com.intellij.debugger.DebuggerManagerEx in project intellij-community by JetBrains.

the class ToggleMethodBreakpointAction method actionPerformed.

public void actionPerformed(AnActionEvent e) {
    Project project = e.getData(CommonDataKeys.PROJECT);
    if (project == null) {
        return;
    }
    DebuggerManagerEx debugManager = DebuggerManagerEx.getInstanceEx(project);
    if (debugManager == null) {
        return;
    }
    final BreakpointManager manager = debugManager.getBreakpointManager();
    final PlaceInDocument place = getPlace(e);
    if (place != null && DocumentUtil.isValidOffset(place.getOffset(), place.getDocument())) {
        Breakpoint breakpoint = manager.findBreakpoint(place.getDocument(), place.getOffset(), MethodBreakpoint.CATEGORY);
        if (breakpoint == null) {
            manager.addMethodBreakpoint(place.getDocument(), place.getDocument().getLineNumber(place.getOffset()));
        } else {
            manager.removeBreakpoint(breakpoint);
        }
    }
}
Also used : Project(com.intellij.openapi.project.Project) MethodBreakpoint(com.intellij.debugger.ui.breakpoints.MethodBreakpoint) Breakpoint(com.intellij.debugger.ui.breakpoints.Breakpoint) DebuggerManagerEx(com.intellij.debugger.DebuggerManagerEx) BreakpointManager(com.intellij.debugger.ui.breakpoints.BreakpointManager)

Example 7 with DebuggerManagerEx

use of com.intellij.debugger.DebuggerManagerEx in project intellij-community by JetBrains.

the class JavaAwareTestConsoleProperties method getDebugSession.

@Nullable
public DebuggerSession getDebugSession() {
    final DebuggerManagerEx debuggerManager = DebuggerManagerEx.getInstanceEx(getProject());
    if (debuggerManager == null)
        return null;
    final Collection<DebuggerSession> sessions = debuggerManager.getSessions();
    for (final DebuggerSession debuggerSession : sessions) {
        if (getConsole() == debuggerSession.getProcess().getExecutionResult().getExecutionConsole())
            return debuggerSession;
    }
    return null;
}
Also used : DebuggerManagerEx(com.intellij.debugger.DebuggerManagerEx) DebuggerSession(com.intellij.debugger.impl.DebuggerSession) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

DebuggerManagerEx (com.intellij.debugger.DebuggerManagerEx)7 DebuggerSession (com.intellij.debugger.impl.DebuggerSession)4 Breakpoint (com.intellij.debugger.ui.breakpoints.Breakpoint)4 Project (com.intellij.openapi.project.Project)4 BreakpointManager (com.intellij.debugger.ui.breakpoints.BreakpointManager)3 Client (com.android.ddmlib.Client)1 InstantRunClient (com.android.tools.fd.client.InstantRunClient)1 InstantRunPushFailedException (com.android.tools.fd.client.InstantRunPushFailedException)1 InstanceFilter (com.intellij.debugger.InstanceFilter)1 SourcePosition (com.intellij.debugger.SourcePosition)1 SuspendContextImpl (com.intellij.debugger.engine.SuspendContextImpl)1 DebuggerCommandImpl (com.intellij.debugger.engine.events.DebuggerCommandImpl)1 DebuggerContextImpl (com.intellij.debugger.impl.DebuggerContextImpl)1 FieldBreakpoint (com.intellij.debugger.ui.breakpoints.FieldBreakpoint)1 MethodBreakpoint (com.intellij.debugger.ui.breakpoints.MethodBreakpoint)1 DebuggerTreeNodeImpl (com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl)1 FieldDescriptorImpl (com.intellij.debugger.ui.impl.watch.FieldDescriptorImpl)1 Document (com.intellij.openapi.editor.Document)1 Editor (com.intellij.openapi.editor.Editor)1 XDebugSession (com.intellij.xdebugger.XDebugSession)1