mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Support for ICDIBreakpointManagment2, breaks are enabled/disabled when they are set.
This commit is contained in:
parent
608dfc4e8f
commit
b4340ada20
9 changed files with 61 additions and 39 deletions
|
@ -425,7 +425,7 @@ public class BreakpointManager extends Manager {
|
|||
if (allMIBreakpoints[i].isAccessWatchpoint() || allMIBreakpoints[i].isWriteWatchpoint()) {
|
||||
watchType |= ICDIWatchpoint.WRITE;
|
||||
}
|
||||
Watchpoint wpoint = new Watchpoint(target, allMIBreakpoints[i].getWhat(), type, watchType, condition);
|
||||
Watchpoint wpoint = new Watchpoint(target, allMIBreakpoints[i].getWhat(), type, watchType, condition, allMIBreakpoints[i].isEnabled());
|
||||
wpoint.setMIBreakpoints(new MIBreakpoint[] {allMIBreakpoints[i]});
|
||||
bList.add(wpoint);
|
||||
} else {
|
||||
|
@ -433,25 +433,26 @@ public class BreakpointManager extends Manager {
|
|||
String file = allMIBreakpoints[i].getFile();
|
||||
int line = allMIBreakpoints[i].getLine();
|
||||
String addr = allMIBreakpoints[i].getAddress();
|
||||
boolean enabled = allMIBreakpoints[i].isEnabled();
|
||||
|
||||
if (file != null && file.length() > 0 && line > 0) {
|
||||
LineLocation location = createLineLocation (allMIBreakpoints[i].getFile(),
|
||||
allMIBreakpoints[i].getLine());
|
||||
// By default new breakpoint are LineBreakpoint
|
||||
Breakpoint newBreakpoint = new LineBreakpoint(target, type, location, condition);
|
||||
Breakpoint newBreakpoint = new LineBreakpoint(target, type, location, condition, enabled);
|
||||
newBreakpoint.setMIBreakpoints(new MIBreakpoint[] {allMIBreakpoints[i]});
|
||||
bList.add(newBreakpoint);
|
||||
} else if (function != null && function.length() > 0) {
|
||||
FunctionLocation location = createFunctionLocation(file, function);
|
||||
// By default new breakpoint are LineBreakpoint
|
||||
Breakpoint newBreakpoint = new FunctionBreakpoint(target, type, location, condition);
|
||||
Breakpoint newBreakpoint = new FunctionBreakpoint(target, type, location, condition, enabled);
|
||||
newBreakpoint.setMIBreakpoints(new MIBreakpoint[] {allMIBreakpoints[i]});
|
||||
bList.add(newBreakpoint);
|
||||
} else if (addr != null && addr.length() > 0) {
|
||||
BigInteger big = MIFormat.getBigInteger(addr);
|
||||
AddressLocation location = createAddressLocation (big);
|
||||
// By default new breakpoint are LineBreakpoint
|
||||
Breakpoint newBreakpoint = new AddressBreakpoint(target, type, location, condition);
|
||||
Breakpoint newBreakpoint = new AddressBreakpoint(target, type, location, condition, enabled);
|
||||
newBreakpoint.setMIBreakpoints(new MIBreakpoint[] {allMIBreakpoints[i]});
|
||||
bList.add(newBreakpoint);
|
||||
}
|
||||
|
@ -604,8 +605,8 @@ public class BreakpointManager extends Manager {
|
|||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpointManagement#setLineBreakpoint(int, org.eclipse.cdt.debug.core.cdi.ICDILineLocation, org.eclipse.cdt.debug.core.cdi.ICDICondition, boolean)
|
||||
*/
|
||||
public ICDILineBreakpoint setLineBreakpoint(Target target, int type, ICDILineLocation location,
|
||||
ICDICondition condition, boolean deferred) throws CDIException {
|
||||
LineBreakpoint bkpt = new LineBreakpoint(target, type, location, condition);
|
||||
ICDICondition condition, boolean deferred, boolean enabled) throws CDIException {
|
||||
LineBreakpoint bkpt = new LineBreakpoint(target, type, location, condition, enabled);
|
||||
setNewLocationBreakpoint(bkpt, deferred);
|
||||
return bkpt;
|
||||
}
|
||||
|
@ -614,8 +615,8 @@ public class BreakpointManager extends Manager {
|
|||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpointManagement#setFunctionBreakpoint(int, org.eclipse.cdt.debug.core.cdi.ICDIFunctionLocation, org.eclipse.cdt.debug.core.cdi.ICDICondition, boolean)
|
||||
*/
|
||||
public ICDIFunctionBreakpoint setFunctionBreakpoint(Target target, int type, ICDIFunctionLocation location,
|
||||
ICDICondition condition, boolean deferred) throws CDIException {
|
||||
FunctionBreakpoint bkpt = new FunctionBreakpoint(target, type, location, condition);
|
||||
ICDICondition condition, boolean deferred, boolean enabled) throws CDIException {
|
||||
FunctionBreakpoint bkpt = new FunctionBreakpoint(target, type, location, condition, enabled);
|
||||
setNewLocationBreakpoint(bkpt, deferred);
|
||||
return bkpt;
|
||||
}
|
||||
|
@ -624,8 +625,8 @@ public class BreakpointManager extends Manager {
|
|||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpointManagement#setAddressBreakpoint(int, org.eclipse.cdt.debug.core.cdi.ICDIAddressLocation, org.eclipse.cdt.debug.core.cdi.ICDICondition, boolean)
|
||||
*/
|
||||
public ICDIAddressBreakpoint setAddressBreakpoint(Target target, int type, ICDIAddressLocation location,
|
||||
ICDICondition condition, boolean deferred) throws CDIException {
|
||||
AddressBreakpoint bkpt = new AddressBreakpoint(target, type, location, condition);
|
||||
ICDICondition condition, boolean deferred, boolean enabled) throws CDIException {
|
||||
AddressBreakpoint bkpt = new AddressBreakpoint(target, type, location, condition, enabled);
|
||||
setNewLocationBreakpoint(bkpt, deferred);
|
||||
return bkpt;
|
||||
}
|
||||
|
@ -664,7 +665,7 @@ public class BreakpointManager extends Manager {
|
|||
}
|
||||
|
||||
public ICDIWatchpoint setWatchpoint(Target target, int type, int watchType, String expression,
|
||||
ICDICondition condition) throws CDIException {
|
||||
ICDICondition condition, boolean enabled) throws CDIException {
|
||||
|
||||
// HACK: for the IDE,
|
||||
try {
|
||||
|
@ -674,7 +675,7 @@ public class BreakpointManager extends Manager {
|
|||
} catch (NumberFormatException e) {
|
||||
//
|
||||
}
|
||||
Watchpoint bkpt = new Watchpoint(target, expression, type, watchType, condition);
|
||||
Watchpoint bkpt = new Watchpoint(target, expression, type, watchType, condition, enabled);
|
||||
|
||||
setWatchpoint(bkpt);
|
||||
List bList = getBreakpointsList(target);
|
||||
|
@ -821,7 +822,7 @@ public class BreakpointManager extends Manager {
|
|||
|
||||
|
||||
public ICDIExceptionpoint setExceptionpoint(Target target, String clazz, boolean stopOnThrow,
|
||||
boolean stopOnCatch) throws CDIException {
|
||||
boolean stopOnCatch, boolean enabled) throws CDIException {
|
||||
|
||||
if (!stopOnThrow && !stopOnCatch) {
|
||||
throw new CDIException("Must suspend on throw or catch"); //$NON-NLS-1$
|
||||
|
@ -834,7 +835,7 @@ public class BreakpointManager extends Manager {
|
|||
int id = EXCEPTION_THROW_IDX;
|
||||
if (exceptionBps[EXCEPTION_THROW_IDX] == null) {
|
||||
FunctionLocation location = new FunctionLocation(null, EXCEPTION_FUNCS[id]);
|
||||
FunctionBreakpoint bp = new FunctionBreakpoint(target, ICDIBreakpoint.REGULAR, location, null);
|
||||
FunctionBreakpoint bp = new FunctionBreakpoint(target, ICDIBreakpoint.REGULAR, location, null, enabled);
|
||||
setLocationBreakpoint(bp);
|
||||
exceptionBps[id] = bp;
|
||||
miBreakpoints = bp.getMIBreakpoints();
|
||||
|
@ -846,7 +847,7 @@ public class BreakpointManager extends Manager {
|
|||
int id = EXCEPTION_THROW_IDX;
|
||||
if (exceptionBps[id] == null) {
|
||||
FunctionLocation location = new FunctionLocation(null, EXCEPTION_FUNCS[id]);
|
||||
FunctionBreakpoint bp = new FunctionBreakpoint(target, ICDIBreakpoint.REGULAR, location, null);
|
||||
FunctionBreakpoint bp = new FunctionBreakpoint(target, ICDIBreakpoint.REGULAR, location, null, enabled);
|
||||
setLocationBreakpoint(bp);
|
||||
exceptionBps[id] = bp;
|
||||
if (miBreakpoints != null) {
|
||||
|
@ -861,7 +862,7 @@ public class BreakpointManager extends Manager {
|
|||
}
|
||||
}
|
||||
|
||||
Exceptionpoint excp = new Exceptionpoint(target, clazz, stopOnThrow, stopOnCatch, null);
|
||||
Exceptionpoint excp = new Exceptionpoint(target, clazz, stopOnThrow, stopOnCatch, null, enabled);
|
||||
if (miBreakpoints != null && miBreakpoints.length > 0) {
|
||||
excp.setMIBreakpoints(miBreakpoints);
|
||||
List blist = getBreakpointsList(target);
|
||||
|
|
|
@ -19,8 +19,8 @@ public class AddressBreakpoint extends LocationBreakpoint implements
|
|||
ICDIAddressBreakpoint {
|
||||
|
||||
public AddressBreakpoint(Target target, int kind, ICDILocation loc,
|
||||
ICDICondition cond) {
|
||||
super(target, kind, loc, cond);
|
||||
ICDICondition cond, boolean enabled) {
|
||||
super(target, kind, loc, cond, enabled);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -30,11 +30,11 @@ public abstract class Breakpoint extends CObject implements ICDIBreakpoint {
|
|||
int type;
|
||||
boolean enable;
|
||||
|
||||
public Breakpoint(Target target, int kind, ICDICondition cond) {
|
||||
public Breakpoint(Target target, int kind, ICDICondition cond, boolean enabled) {
|
||||
super(target);
|
||||
type = kind;
|
||||
condition = cond;
|
||||
enable = true;
|
||||
enable = enabled;
|
||||
}
|
||||
|
||||
public MIBreakpoint[] getMIBreakpoints() {
|
||||
|
|
|
@ -26,8 +26,8 @@ public class Exceptionpoint extends Breakpoint implements ICDIExceptionpoint {
|
|||
|
||||
/**
|
||||
*/
|
||||
public Exceptionpoint(Target target, String clazz, boolean stopOnThrow, boolean stopOnCatch, ICDICondition cond) {
|
||||
super(target, ICDIBreakpoint.REGULAR, cond);
|
||||
public Exceptionpoint(Target target, String clazz, boolean stopOnThrow, boolean stopOnCatch, ICDICondition cond, boolean enabled) {
|
||||
super(target, ICDIBreakpoint.REGULAR, cond, enabled);
|
||||
fClazz = clazz;
|
||||
fStopOnThrow = stopOnThrow;
|
||||
fStopOnCatch = stopOnCatch;
|
||||
|
|
|
@ -19,8 +19,8 @@ public class FunctionBreakpoint extends LocationBreakpoint implements
|
|||
ICDIFunctionBreakpoint {
|
||||
|
||||
public FunctionBreakpoint(Target target, int kind, ICDILocation loc,
|
||||
ICDICondition cond) {
|
||||
super(target, kind, loc, cond);
|
||||
ICDICondition cond, boolean enabled) {
|
||||
super(target, kind, loc, cond, enabled);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,8 +17,8 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDILineBreakpoint;
|
|||
|
||||
public class LineBreakpoint extends LocationBreakpoint implements ICDILineBreakpoint {
|
||||
|
||||
public LineBreakpoint(Target target, int kind, ICDILineLocation loc, ICDICondition cond) {
|
||||
super(target, kind, loc, cond);
|
||||
public LineBreakpoint(Target target, int kind, ICDILineLocation loc, ICDICondition cond, boolean enabled) {
|
||||
super(target, kind, loc, cond, enabled);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -27,8 +27,8 @@ public abstract class LocationBreakpoint extends Breakpoint implements ICDIBreak
|
|||
|
||||
ICDILocation fLocation;
|
||||
|
||||
public LocationBreakpoint(Target target, int kind, ICDILocation loc, ICDICondition cond) {
|
||||
super(target, kind, cond);
|
||||
public LocationBreakpoint(Target target, int kind, ICDILocation loc, ICDICondition cond, boolean enabled) {
|
||||
super(target, kind, cond, enabled);
|
||||
fLocation = loc;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.eclipse.cdt.debug.core.cdi.ICDILineLocation;
|
|||
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIAddressBreakpoint;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpointManagement2;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIExceptionpoint;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIExpression;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIFunctionBreakpoint;
|
||||
|
@ -87,7 +88,7 @@ import org.eclipse.core.runtime.Path;
|
|||
|
||||
/**
|
||||
*/
|
||||
public class Target extends SessionObject implements ICDITarget {
|
||||
public class Target extends SessionObject implements ICDITarget, ICDIBreakpointManagement2 {
|
||||
|
||||
public class Lock {
|
||||
|
||||
|
@ -864,8 +865,7 @@ public class Target extends SessionObject implements ICDITarget {
|
|||
*/
|
||||
public ICDILineBreakpoint setLineBreakpoint(int type, ICDILineLocation location,
|
||||
ICDICondition condition, boolean deferred) throws CDIException {
|
||||
BreakpointManager bMgr = ((Session)getSession()).getBreakpointManager();
|
||||
return bMgr.setLineBreakpoint(this, type, location, condition, deferred);
|
||||
return this.setLineBreakpoint(type, location, condition, deferred, true);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -873,8 +873,7 @@ public class Target extends SessionObject implements ICDITarget {
|
|||
*/
|
||||
public ICDIFunctionBreakpoint setFunctionBreakpoint(int type, ICDIFunctionLocation location,
|
||||
ICDICondition condition, boolean deferred) throws CDIException {
|
||||
BreakpointManager bMgr = ((Session)getSession()).getBreakpointManager();
|
||||
return bMgr.setFunctionBreakpoint(this, type, location, condition, deferred);
|
||||
return this.setFunctionBreakpoint(type, location, condition, deferred, true);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -882,8 +881,7 @@ public class Target extends SessionObject implements ICDITarget {
|
|||
*/
|
||||
public ICDIAddressBreakpoint setAddressBreakpoint(int type, ICDIAddressLocation location,
|
||||
ICDICondition condition, boolean deferred) throws CDIException {
|
||||
BreakpointManager bMgr = ((Session)getSession()).getBreakpointManager();
|
||||
return bMgr.setAddressBreakpoint(this, type, location, condition, deferred);
|
||||
return this.setAddressBreakpoint(type, location, condition, deferred, true);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -891,8 +889,7 @@ public class Target extends SessionObject implements ICDITarget {
|
|||
*/
|
||||
public ICDIWatchpoint setWatchpoint(int type, int watchType, String expression,
|
||||
ICDICondition condition) throws CDIException {
|
||||
BreakpointManager bMgr = ((Session)getSession()).getBreakpointManager();
|
||||
return bMgr.setWatchpoint(this, type, watchType, expression, condition);
|
||||
return this.setWatchpoint(type, watchType, expression, condition, true);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -1192,4 +1189,28 @@ public class Target extends SessionObject implements ICDITarget {
|
|||
public boolean isVerboseModeEnabled() {
|
||||
return miSession.isVerboseModeEnabled();
|
||||
}
|
||||
|
||||
public ICDIAddressBreakpoint setAddressBreakpoint(int type, ICDIAddressLocation location, ICDICondition condition, boolean deferred, boolean enabled) throws CDIException {
|
||||
BreakpointManager bMgr = ((Session)getSession()).getBreakpointManager();
|
||||
return bMgr.setAddressBreakpoint(this, type, location, condition, deferred, enabled);
|
||||
}
|
||||
|
||||
public ICDIExceptionpoint setExceptionBreakpoint(String clazz, boolean stopOnThrow, boolean stopOnCatch, boolean enabled) throws CDIException {
|
||||
throw new CDIException(CdiResources.getString("cdi.Common.Not_implemented")); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public ICDIFunctionBreakpoint setFunctionBreakpoint(int type, ICDIFunctionLocation location, ICDICondition condition, boolean deferred, boolean enabled) throws CDIException {
|
||||
BreakpointManager bMgr = ((Session)getSession()).getBreakpointManager();
|
||||
return bMgr.setFunctionBreakpoint(this, type, location, condition, deferred, enabled);
|
||||
}
|
||||
|
||||
public ICDILineBreakpoint setLineBreakpoint(int type, ICDILineLocation location, ICDICondition condition, boolean deferred, boolean enabled) throws CDIException {
|
||||
BreakpointManager bMgr = ((Session)getSession()).getBreakpointManager();
|
||||
return bMgr.setLineBreakpoint(this, type, location, condition, deferred, enabled);
|
||||
}
|
||||
|
||||
public ICDIWatchpoint setWatchpoint(int type, int watchType, String expression, ICDICondition condition, boolean enabled) throws CDIException {
|
||||
BreakpointManager bMgr = ((Session)getSession()).getBreakpointManager();
|
||||
return bMgr.setWatchpoint(this, type, watchType, expression, condition, enabled);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,8 +22,8 @@ public class Watchpoint extends Breakpoint implements ICDIWatchpoint {
|
|||
int watchType;
|
||||
String what;
|
||||
|
||||
public Watchpoint(Target target, String expression, int type, int wType, ICDICondition cond) {
|
||||
super(target, type, cond);
|
||||
public Watchpoint(Target target, String expression, int type, int wType, ICDICondition cond, boolean enabled) {
|
||||
super(target, type, cond, enabled);
|
||||
watchType = wType;
|
||||
what = expression;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue