WI-23626 Breakpoint muting does not disable after run. Regression from 7.1.3 to EAP 8.

This commit is contained in:
Egor.Ushakov
2014-06-06 15:59:50 +04:00
parent ffcf607799
commit 539f90a09d
12 changed files with 80 additions and 68 deletions
@@ -16,7 +16,6 @@
package com.intellij.debugger.engine;
import com.intellij.debugger.DebuggerBundle;
import com.intellij.debugger.DebuggerInvocationUtil;
import com.intellij.debugger.actions.DebuggerActions;
import com.intellij.debugger.engine.evaluation.EvaluationContext;
import com.intellij.debugger.engine.evaluation.EvaluationContextImpl;
@@ -41,7 +40,6 @@ import com.intellij.execution.ui.layout.PlaceInGrid;
import com.intellij.icons.AllIcons;
import com.intellij.idea.ActionsBundle;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileEditor.FileDocumentManager;
@@ -171,18 +169,6 @@ public class JavaDebugProcess extends XDebugProcess {
DebuggerContextUtil.setStackFrame(javaSession.getContextManager(), ((JavaStackFrame)frame).getStackFrameProxy());
}
}
@Override
public void sessionStopped() {
if (DebuggerSettings.getInstance().UNMUTE_ON_STOP) {
ApplicationManager.getApplication().runReadAction(new Runnable() {
@Override
public void run() {
session.setBreakpointMuted(false);
}
});
}
}
});
}
@@ -336,7 +322,6 @@ public class JavaDebugProcess extends XDebugProcess {
};
settings.add(new WatchLastMethodReturnValueAction());
settings.add(new AutoVarsSwitchAction());
settings.add(new UnmuteOnStopAction());
settings.addSeparator();
addActionToGroup(settings, XDebuggerActions.AUTO_TOOLTIP);
@@ -69,7 +69,6 @@ public class DebuggerSettings implements JDOMExternalizable, NamedComponent, Clo
public volatile boolean WATCH_RETURN_VALUES = false;
public volatile boolean AUTO_VARIABLES_MODE = false;
public volatile boolean SHOW_LIBRARY_STACKFRAMES = true;
public volatile boolean UNMUTE_ON_STOP = false;
private ClassFilter[] mySteppingFilters = ClassFilter.EMPTY_ARRAY;
@@ -324,7 +324,6 @@ public class DebuggerSessionTab extends DebuggerSessionTabBase implements Dispos
}
settings.add(new WatchLastMethodReturnValueAction());
settings.add(new AutoVarsSwitchAction());
settings.add(new UnmuteOnStopAction());
settings.addSeparator();
addActionToGroup(settings, XDebuggerActions.AUTO_TOOLTIP);
@@ -597,24 +596,4 @@ public class DebuggerSessionTab extends DebuggerSessionTabBase implements Dispos
}
}
}
private class UnmuteOnStopAction extends ToggleAction {
private volatile boolean myUnmuteOnStop;
private UnmuteOnStopAction() {
super(DebuggerBundle.message("action.unmute.on.stop.text"), DebuggerBundle.message("action.unmute.on.stop.text"), null);
myUnmuteOnStop = DebuggerSettings.getInstance().UNMUTE_ON_STOP;
}
@Override
public boolean isSelected(AnActionEvent e) {
return myUnmuteOnStop;
}
@Override
public void setSelected(AnActionEvent e, boolean state) {
myUnmuteOnStop = state;
DebuggerSettings.getInstance().UNMUTE_ON_STOP = state;
}
}
}
@@ -961,6 +961,7 @@ action.Debugger.MarkObject.unmark.text=Unmark Object
action.Debugger.MarkObject.description=Mark/unmark the object so that it can be visually distinguished in in debugger views
action.Debugger.AddToWatch.text=Add to Watches
action.Debugger.EvaluateInConsole.text=Evaluate in Console
action.Debugger.UnmuteOnStop.text=Unmute breakpoints on session finish
action.Debugger.AutoRenderer.text=Auto
group.EditorPopupMenu.text=Editor Popup Menu
group.EditorPopupMenu.description=Editor Popup Menu
@@ -757,7 +757,7 @@
</group>
<group id="XDebugger.Settings" icon="AllIcons.General.SecondaryGroup" popup="true">
<action id="Debugger.UnmuteOnStop" class="com.intellij.xdebugger.impl.actions.UnmuteOnStopAction"/>
</group>
<group id="RunnerLayoutActions">
@@ -61,6 +61,7 @@ import com.intellij.xdebugger.frame.XValueMarkerProvider;
import com.intellij.xdebugger.impl.breakpoints.*;
import com.intellij.xdebugger.impl.evaluate.quick.common.ValueLookupManager;
import com.intellij.xdebugger.impl.frame.XValueMarkers;
import com.intellij.xdebugger.impl.settings.XDebuggerSettingsManager;
import com.intellij.xdebugger.impl.ui.XDebugSessionData;
import com.intellij.xdebugger.impl.ui.XDebugSessionTab;
import com.intellij.xdebugger.impl.ui.XDebuggerUIConstants;
@@ -837,6 +838,9 @@ public class XDebugSessionImpl implements XDebugSession {
if (myValueMarkers != null) {
myValueMarkers.clear();
}
if (XDebuggerSettingsManager.getInstance().getGeneralSettings().isUnmuteOnStop()) {
mySessionData.setBreakpointsMuted(false);
}
myStopped = true;
myDebuggerManager.removeSession(this);
myDispatcher.getMulticaster().sessionStopped();
@@ -13,32 +13,24 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.debugger.engine;
package com.intellij.xdebugger.impl.actions;
import com.intellij.debugger.DebuggerBundle;
import com.intellij.debugger.settings.DebuggerSettings;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.ToggleAction;
import com.intellij.openapi.project.DumbAware;
import com.intellij.xdebugger.impl.settings.XDebuggerSettingsManager;
/**
* @author egor
*/
class UnmuteOnStopAction extends ToggleAction {
private volatile boolean myUnmuteOnStop;
UnmuteOnStopAction() {
super(DebuggerBundle.message("action.unmute.on.stop.text"), DebuggerBundle.message("action.unmute.on.stop.text"), null);
myUnmuteOnStop = DebuggerSettings.getInstance().UNMUTE_ON_STOP;
}
* @author egor
*/
public class UnmuteOnStopAction extends ToggleAction implements DumbAware {
@Override
public boolean isSelected(AnActionEvent e) {
return myUnmuteOnStop;
return XDebuggerSettingsManager.getInstance().getGeneralSettings().isUnmuteOnStop();
}
@Override
public void setSelected(AnActionEvent e, boolean state) {
myUnmuteOnStop = state;
DebuggerSettings.getInstance().UNMUTE_ON_STOP = state;
XDebuggerSettingsManager.getInstance().getGeneralSettings().setUnmuteOnStop(state);
}
}
}
@@ -114,7 +114,7 @@ public class XDebuggerEvaluationDialog extends DialogWrapper {
myTreePanel.getTree().addTreeListener(new MyTreeListener());
EvaluationMode mode = XDebuggerSettingsManager.getInstance().getDataViewSettings().getEvaluationDialogMode();
EvaluationMode mode = XDebuggerSettingsManager.getInstance().getGeneralSettings().getEvaluationDialogMode();
myIsCodeFragmentEvaluationSupported = evaluator.isCodeFragmentEvaluationSupported();
if (mode == EvaluationMode.CODE_FRAGMENT && !myIsCodeFragmentEvaluationSupported) {
mode = EvaluationMode.EXPRESSION;
@@ -171,7 +171,7 @@ public class XDebuggerEvaluationDialog extends DialogWrapper {
private void switchToMode(EvaluationMode mode, XExpression text) {
if (myMode == mode) return;
XDebuggerSettingsManager.getInstance().getDataViewSettings().setEvaluationDialogMode(mode);
XDebuggerSettingsManager.getInstance().getGeneralSettings().setEvaluationDialogMode(mode);
myMode = mode;
@@ -24,7 +24,6 @@ import com.intellij.xdebugger.evaluation.EvaluationMode;
@Tag("data-views")
public class XDebuggerDataViewSettings {
private boolean mySortValues;
private EvaluationMode myEvaluationDialogMode = EvaluationMode.EXPRESSION;
@Tag("sort-values")
public boolean isSortValues() {
@@ -34,13 +33,4 @@ public class XDebuggerDataViewSettings {
public void setSortValues(boolean sortValues) {
mySortValues = sortValues;
}
@Tag("evaluation-dialog-mode")
public EvaluationMode getEvaluationDialogMode() {
return myEvaluationDialogMode;
}
public void setEvaluationDialogMode(EvaluationMode evaluationDialogMode) {
myEvaluationDialogMode = evaluationDialogMode;
}
}
@@ -0,0 +1,46 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.xdebugger.impl.settings;
import com.intellij.util.xmlb.annotations.Tag;
import com.intellij.xdebugger.evaluation.EvaluationMode;
/**
* @author egor
*/
@Tag("general")
public class XDebuggerGeneralSettings {
private EvaluationMode myEvaluationDialogMode = EvaluationMode.EXPRESSION;
private boolean myUnmuteOnStop = false;
@Tag("evaluation-dialog-mode")
public EvaluationMode getEvaluationDialogMode() {
return myEvaluationDialogMode;
}
public void setEvaluationDialogMode(EvaluationMode evaluationDialogMode) {
myEvaluationDialogMode = evaluationDialogMode;
}
@Tag("unmute-on-stop")
public boolean isUnmuteOnStop() {
return myUnmuteOnStop;
}
public void setUnmuteOnStop(boolean unmuteOnStop) {
myUnmuteOnStop = unmuteOnStop;
}
}
@@ -45,6 +45,7 @@ public class XDebuggerSettingsManager implements PersistentStateComponent<XDebug
private Map<String, XDebuggerSettings<?>> mySettingsById;
private Map<Class<? extends XDebuggerSettings>, XDebuggerSettings<?>> mySettingsByClass;
private XDebuggerDataViewSettings myDataViewSettings = new XDebuggerDataViewSettings();
private XDebuggerGeneralSettings myGeneralSettings = new XDebuggerGeneralSettings();
public static XDebuggerSettingsManager getInstance() {
return ServiceManager.getService(XDebuggerSettingsManager.class);
@@ -53,6 +54,7 @@ public class XDebuggerSettingsManager implements PersistentStateComponent<XDebug
public SettingsState getState() {
SettingsState settingsState = new SettingsState();
settingsState.setDataViewSettings(myDataViewSettings);
settingsState.setGeneralSettings(myGeneralSettings);
for (XDebuggerSettings<?> settings : getSettingsList()) {
SpecificSettingsState state = new SpecificSettingsState();
state.setId(settings.getId());
@@ -71,8 +73,13 @@ public class XDebuggerSettingsManager implements PersistentStateComponent<XDebug
return myDataViewSettings;
}
public XDebuggerGeneralSettings getGeneralSettings() {
return myGeneralSettings;
}
public void loadState(final SettingsState state) {
myDataViewSettings = state.getDataViewSettings();
myGeneralSettings = state.getGeneralSettings();
for (SpecificSettingsState settingsState : state.getSpecificStates()) {
XDebuggerSettings<?> settings = findSettings(settingsState.getId());
if (settings != null) {
@@ -106,6 +113,7 @@ public class XDebuggerSettingsManager implements PersistentStateComponent<XDebug
public static class SettingsState {
private List<SpecificSettingsState> mySpecificStates = new ArrayList<SpecificSettingsState>();
private XDebuggerDataViewSettings myDataViewSettings = new XDebuggerDataViewSettings();
private XDebuggerGeneralSettings myGeneralSettings = new XDebuggerGeneralSettings();
@Tag("debuggers")
@AbstractCollection(surroundWithTag = false)
@@ -125,6 +133,15 @@ public class XDebuggerSettingsManager implements PersistentStateComponent<XDebug
public void setDataViewSettings(XDebuggerDataViewSettings dataViewSettings) {
myDataViewSettings = dataViewSettings;
}
@Property(surroundWithTag = false)
public XDebuggerGeneralSettings getGeneralSettings() {
return myGeneralSettings;
}
public void setGeneralSettings(XDebuggerGeneralSettings generalSettings) {
myGeneralSettings = generalSettings;
}
}
@Tag("debugger")
@@ -431,7 +431,6 @@ title.smart.step.popup=Method to Step Into
action.show.watches.description=Shows or hides 'watches' pane
action.show.watches.text.hide=Hide Watches
action.show.watches.text.show=Show Watches
action.unmute.on.stop.text=Unmute breakpoints on session finish
action.watch.method.return.value.description=Enables watching last executed method return value
action.watches.method.return.value.enable=Watch method return values
action.watches.method.return.value.disable=Stop watching method return values