(no message)

This commit is contained in:
Eugene Zhuravlev
2005-03-15 19:21:10 +03:00
parent c2fc4cf1c0
commit 9f93422fb6
9 changed files with 86 additions and 5 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

+1
View File
@@ -688,6 +688,7 @@
<action id="Debugger.ShowFrame" class="com.intellij.debugger.actions.ShowFrameAction" text="Show Frame"/>
<action id="Debugger.ResumeThread" class="com.intellij.debugger.actions.ResumeThreadAction" text="Resume"/>
<action id="Debugger.FreezeThread" class="com.intellij.debugger.actions.FreezeThreadAction" text="Freeze"/>
<action id="Debugger.MuteBreakpoints" class="com.intellij.debugger.actions.MuteBreakpointsAction" text="Mute Breakpoints" icon="/debugger/muteBreakpoints.png" description="Mute/unmute all breakpoints in a debug session."/>
<action id="Debugger.ToggleStepThreadSuspendPolicy" class="com.intellij.debugger.actions.ToggleStepThreadSuspendPolicyAction" text="Suspend All Threads While Stepping" icon="/debugger/suspend_all.png" description="Toggles whether all threads or only current thread will be suspended while stepping."/>
<action id="Debugger.AddToWatch" class="com.intellij.debugger.actions.AddToWatchAction" text="Add to Watches"/>
</group>
@@ -28,6 +28,7 @@ public interface DebuggerActions {
String EDIT_WATCH = "Debugger.EditWatch";
String EDIT_FRAME_SOURCE = "Debugger.EditFrameSource";
String EDIT_NODE_SOURCE = "Debugger.EditNodeSource";
String MUTE_BREAKPOINTS = "Debugger.MuteBreakpoints";
String TOGGLE_STEP_SUSPEND_POLICY = "Debugger.ToggleStepThreadSuspendPolicy";
String REPRESENTATION_LIST = "Debugger.Representation";
}
@@ -0,0 +1,42 @@
/*
* Copyright (c) 2000-2004 by JetBrains s.r.o. All Rights Reserved.
* Use is subject to license terms.
*/
package com.intellij.debugger.actions;
import com.intellij.debugger.engine.DebugProcessImpl;
import com.intellij.debugger.impl.DebuggerContextImpl;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.ToggleAction;
/**
* @author Eugene Zhuravlev
* Date: Mar 15, 2005
*/
public class MuteBreakpointsAction extends ToggleAction{
public boolean isSelected(AnActionEvent e) {
DebuggerContextImpl context = DebuggerAction.getDebuggerContext(e.getDataContext());
DebugProcessImpl debugProcess = context.getDebugProcess();
if(debugProcess != null) {
return debugProcess.areBreakpointsMuted();
}
return false;
}
public void setSelected(AnActionEvent e, boolean state) {
DebuggerContextImpl context = DebuggerAction.getDebuggerContext(e.getDataContext());
final DebugProcessImpl debugProcess = context.getDebugProcess();
if(debugProcess != null) {
debugProcess.setBreakpointsMuted(state);
}
}
public void update(final AnActionEvent e) {
super.update(e);
DebuggerContextImpl context = DebuggerAction.getDebuggerContext(e.getDataContext());
final DebugProcessImpl debugProcess = context.getDebugProcess();
e.getPresentation().setEnabled(debugProcess != null);
}
}
@@ -22,6 +22,7 @@ import com.intellij.debugger.settings.ViewsGeneralSettings;
import com.intellij.debugger.ui.DebuggerSmoothManager;
import com.intellij.debugger.ui.DescriptorHistoryManagerImpl;
import com.intellij.debugger.ui.breakpoints.LineBreakpoint;
import com.intellij.debugger.ui.breakpoints.BreakpointManager;
import com.intellij.debugger.ui.impl.watch.DescriptorHistoryManager;
import com.intellij.debugger.ui.tree.render.ArrayRenderer;
import com.intellij.debugger.ui.tree.render.ClassRenderer;
@@ -131,6 +132,7 @@ public abstract class DebugProcessImpl implements DebugProcess {
private static int LOCAL_START_TIMEOUT = 15000;
private final Semaphore myWaitFor = new Semaphore();
private boolean myBreakpointsMuted = false;
protected DebugProcessImpl(Project project) {
myProject = project;
@@ -1598,5 +1600,38 @@ public abstract class DebugProcessImpl implements DebugProcess {
public SuspendContextCommandImpl createPopFrameCommand(DebuggerContextImpl context, StackFrameProxyImpl stackFrame) {
return new PopFrameCommand(context, stackFrame);
}
public void setBreakpointsMuted(final boolean muted) {
if (isAttached()) {
getManagerThread().invokeLater(new DebuggerCommandImpl() {
protected void action() throws Exception {
// set the flag before enabling/disabling cause it affects if breakpoints will create requests
synchronized (DebugProcessImpl.this) {
if (myBreakpointsMuted == muted) {
return;
}
myBreakpointsMuted = muted;
}
final BreakpointManager breakpointManager = DebuggerManagerEx.getInstanceEx(myProject).getBreakpointManager();
if (muted) {
breakpointManager.disableBreakpoints(DebugProcessImpl.this);
}
else {
breakpointManager.enableBreakpoints(DebugProcessImpl.this);
}
}
});
}
else {
synchronized (this) {
myBreakpointsMuted = muted;
}
}
}
public synchronized boolean areBreakpointsMuted() {
return myBreakpointsMuted;
}
}
@@ -284,6 +284,8 @@ public class DebuggerSessionTab {
if (action != null) group.add(action);
action = actionManager.getAction(DebuggerActions.VIEW_BREAKPOINTS);
if (action != null) group.add(action);
action = actionManager.getAction(DebuggerActions.MUTE_BREAKPOINTS);
if (action != null) group.add(action);
action = actionManager.getAction(DebuggerActions.TOGGLE_STEP_SUSPEND_POLICY);
if (action != null) group.add(action);
@@ -22,12 +22,12 @@ public class AnyExceptionBreakpoint extends ExceptionBreakpoint {
return "Any exception";
}
public void createRequest(DebugProcessImpl debuggerProcess) {
public void createRequest(DebugProcessImpl debugProcess) {
DebuggerManagerThreadImpl.assertIsManagerThread();
if (!ENABLED || !debuggerProcess.isAttached() || !debuggerProcess.getRequestsManager().findRequests(this).isEmpty()) {
if (!ENABLED || !debugProcess.isAttached() || debugProcess.areBreakpointsMuted() || !debugProcess.getRequestsManager().findRequests(this).isEmpty()) {
return;
}
super.processClassPrepare(debuggerProcess, null);
super.processClassPrepare(debugProcess, null);
}
public void processClassPrepare(DebugProcess debugProcess, ReferenceType refType) {
@@ -222,7 +222,7 @@ public abstract class BreakpointWithHighlighter extends Breakpoint {
public void createRequest(DebugProcessImpl debugProcess) {
DebuggerManagerThreadImpl.assertIsManagerThread();
// check is this breakpoint is enabled, vm reference is valid and there're no requests created yet
if (!ENABLED || !debugProcess.isAttached() || !debugProcess.getRequestsManager().findRequests(this).isEmpty()) {
if (!ENABLED || !debugProcess.isAttached() || debugProcess.areBreakpointsMuted() || !debugProcess.getRequestsManager().findRequests(this).isEmpty()) {
return;
}
@@ -78,7 +78,7 @@ public class ExceptionBreakpoint extends Breakpoint {
public void createRequest(DebugProcessImpl debugProcess) {
DebuggerManagerThreadImpl.assertIsManagerThread();
if (!ENABLED || !debugProcess.isAttached() || !debugProcess.getRequestsManager().findRequests(this).isEmpty()) {
if (!ENABLED || !debugProcess.isAttached() || debugProcess.areBreakpointsMuted() || !debugProcess.getRequestsManager().findRequests(this).isEmpty()) {
return;
}