mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
[248606] Add support for toggling watchpoints in the variables and expressions views.
This commit is contained in:
parent
e78dc0a109
commit
a32879bdc0
4 changed files with 24 additions and 10 deletions
|
@ -1,3 +1,14 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2010 Wind River Systems, Inc. and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Anton Leherbauer (Wind River Systems) - initial API and implementation
|
||||
* Freescale Semiconductor - refactoring
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.internal.core;
|
||||
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
|
|
|
@ -25,7 +25,7 @@ public interface ICWatchpointTarget {
|
|||
|
||||
/** IRequest object used in the asynchronous method {@link ICWatchpointTarget#getSize()} */
|
||||
interface GetSizeRequest extends IRequest {
|
||||
int getSize();
|
||||
int getSize(); // returns -1 if size not available
|
||||
void setSize(int size);
|
||||
};
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ public class AddWatchpointOnVariableActionDelegate extends AddWatchpointActionDe
|
|||
}
|
||||
|
||||
private static class GetSizeRequest extends CRequest implements ICWatchpointTarget.GetSizeRequest {
|
||||
int fSize;
|
||||
int fSize = -1;
|
||||
public int getSize() {
|
||||
return fSize;
|
||||
}
|
||||
|
@ -122,6 +122,7 @@ public class AddWatchpointOnVariableActionDelegate extends AddWatchpointActionDe
|
|||
* org.eclipse.jface.viewers.ISelection)
|
||||
*/
|
||||
public void selectionChanged(final IAction action, ISelection selection) {
|
||||
fVar = null;
|
||||
if (selection == null || selection.isEmpty()) {
|
||||
action.setEnabled(false);
|
||||
return;
|
||||
|
|
|
@ -66,19 +66,23 @@ public class GdbVariableVMNode extends VariableVMNode {
|
|||
if (expressionService != null) {
|
||||
final DataRequestMonitor<IExpressionDMAddress> drm = new DataRequestMonitor<IExpressionDMAddress>(getSession().getExecutor(), null) {
|
||||
@Override
|
||||
public void handleSuccess() {
|
||||
request.setSize(getData().getSize());
|
||||
public void handleCompleted() {
|
||||
if (isSuccess()) {
|
||||
request.setSize(getData().getSize());
|
||||
}
|
||||
request.done();
|
||||
}
|
||||
};
|
||||
|
||||
expressionService.getExpressionAddressData(exprDmc, drm);
|
||||
}
|
||||
else {
|
||||
request.done();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
request.setSize(-1);
|
||||
request.done();
|
||||
}
|
||||
}
|
||||
|
@ -104,24 +108,22 @@ public class GdbVariableVMNode extends VariableVMNode {
|
|||
assert getData().getSize() > 0;
|
||||
request.setCanCreate(true);
|
||||
}
|
||||
else {
|
||||
request.setCanCreate(false);
|
||||
}
|
||||
request.done();
|
||||
}
|
||||
};
|
||||
|
||||
expressionService.getExpressionAddressData(exprDmc, drm);
|
||||
}
|
||||
else {
|
||||
request.done();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
request.setCanCreate(false);
|
||||
request.done();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue