mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 01:15:29 +02:00
Fix for PR 66338
* cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java * cdi/org/eclipse/cdt/debug/mi/core/cdi/Condition.java * cdi/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java * cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Breakpoint.java
This commit is contained in:
parent
788cbb7b7e
commit
7d75673d86
5 changed files with 43 additions and 25 deletions
|
@ -1,3 +1,10 @@
|
|||
2004-06-09 Alain Magloire
|
||||
Fix for PR 66338
|
||||
* cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java
|
||||
* cdi/org/eclipse/cdt/debug/mi/core/cdi/Condition.java
|
||||
* cdi/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java
|
||||
* cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Breakpoint.java
|
||||
|
||||
2004-06-09 Alain Magloire
|
||||
|
||||
Keep the breakpoint disable when doing
|
||||
|
|
|
@ -403,16 +403,15 @@ public class BreakpointManager extends Manager implements ICDIBreakpointManager
|
|||
} catch (CDIException e) {
|
||||
if (!deferred) {
|
||||
throw e;
|
||||
} else {
|
||||
Session session = (Session)getSession();
|
||||
ICDISharedLibraryManager sharedMgr = session.getSharedLibraryManager();
|
||||
if (sharedMgr instanceof SharedLibraryManager) {
|
||||
SharedLibraryManager mgr = (SharedLibraryManager)sharedMgr;
|
||||
if (mgr.isDeferredBreakpoint()) {
|
||||
deferredList.add(bkpt);
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
Session session = (Session)getSession();
|
||||
ICDISharedLibraryManager sharedMgr = session.getSharedLibraryManager();
|
||||
if (sharedMgr instanceof SharedLibraryManager) {
|
||||
SharedLibraryManager mgr = (SharedLibraryManager)sharedMgr;
|
||||
if (mgr.isDeferredBreakpoint()) {
|
||||
deferredList.add(bkpt);
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public class Condition implements ICDICondition {
|
|||
|
||||
public Condition(int ignore, String exp) {
|
||||
ignoreCount = ignore;
|
||||
expression = exp;
|
||||
expression = (exp == null) ? new String() : exp;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -358,12 +358,13 @@ public class EventManager extends SessionObject implements ICDIEventManager, Obs
|
|||
if (bpoints[i] instanceof Breakpoint) {
|
||||
Breakpoint bkpt = (Breakpoint)bpoints[i];
|
||||
try {
|
||||
boolean enable = bkpt.isEnabled();
|
||||
bpMgr.setLocationBreakpoint(bkpt);
|
||||
bpMgr.deleteFromDeferredList(bkpt);
|
||||
bpMgr.addToBreakpointList(bkpt);
|
||||
// If the breakpoint was disable
|
||||
// If the breakpoint was disable in the IDE
|
||||
// install it but keep it disable
|
||||
if (!bkpt.isEnabled()) {
|
||||
if (!enable) {
|
||||
bpMgr.disableBreakpoint(bkpt);
|
||||
}
|
||||
eventList.add(new MIBreakpointCreatedEvent(bkpt.getMIBreakpoint().getNumber()));
|
||||
|
|
|
@ -24,6 +24,7 @@ public class Breakpoint extends CObject implements ICDILocationBreakpoint {
|
|||
BreakpointManager mgr;
|
||||
int type;
|
||||
String tid;
|
||||
boolean enable;
|
||||
|
||||
public Breakpoint(BreakpointManager m, int kind, ICDILocation loc, ICDICondition cond, String threadId) {
|
||||
super(m.getSession().getCurrentTarget());
|
||||
|
@ -32,6 +33,7 @@ public class Breakpoint extends CObject implements ICDILocationBreakpoint {
|
|||
location = loc;
|
||||
condition = cond;
|
||||
tid = threadId;
|
||||
enable = true;
|
||||
}
|
||||
|
||||
public Breakpoint(BreakpointManager m, MIBreakpoint miBreak) {
|
||||
|
@ -46,9 +48,9 @@ public class Breakpoint extends CObject implements ICDILocationBreakpoint {
|
|||
|
||||
public void setMIBreakpoint(MIBreakpoint newMIBreakpoint) {
|
||||
miBreakpoint = newMIBreakpoint;
|
||||
// Force the reset of the location and condition.
|
||||
location = null;
|
||||
// Force the reset to use GDB's values.
|
||||
condition = null;
|
||||
location = null;
|
||||
}
|
||||
|
||||
public boolean isDeferred() {
|
||||
|
@ -60,8 +62,9 @@ public class Breakpoint extends CObject implements ICDILocationBreakpoint {
|
|||
*/
|
||||
public ICDICondition getCondition() throws CDIException {
|
||||
if (condition == null) {
|
||||
if (miBreakpoint != null)
|
||||
if (miBreakpoint != null) {
|
||||
condition = new Condition(miBreakpoint.getIgnoreCount(), miBreakpoint.getCondition());
|
||||
}
|
||||
}
|
||||
return condition;
|
||||
}
|
||||
|
@ -70,8 +73,9 @@ public class Breakpoint extends CObject implements ICDILocationBreakpoint {
|
|||
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpoint#getThreadId()
|
||||
*/
|
||||
public String getThreadId() throws CDIException {
|
||||
if (miBreakpoint != null)
|
||||
if (miBreakpoint != null) {
|
||||
return miBreakpoint.getThreadId();
|
||||
}
|
||||
return tid;
|
||||
}
|
||||
|
||||
|
@ -79,17 +83,19 @@ public class Breakpoint extends CObject implements ICDILocationBreakpoint {
|
|||
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpoint#isEnabled()
|
||||
*/
|
||||
public boolean isEnabled() throws CDIException {
|
||||
if (miBreakpoint != null)
|
||||
if (miBreakpoint != null) {
|
||||
return miBreakpoint.isEnabled();
|
||||
return false;
|
||||
}
|
||||
return enable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpoint#isHardware()
|
||||
*/
|
||||
public boolean isHardware() {
|
||||
if (miBreakpoint != null)
|
||||
if (miBreakpoint != null) {
|
||||
return miBreakpoint.isHardware();
|
||||
}
|
||||
return (type == ICDIBreakpoint.HARDWARE);
|
||||
}
|
||||
|
||||
|
@ -97,8 +103,9 @@ public class Breakpoint extends CObject implements ICDILocationBreakpoint {
|
|||
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpoint#isTemporary()
|
||||
*/
|
||||
public boolean isTemporary() {
|
||||
if (miBreakpoint != null)
|
||||
if (miBreakpoint != null) {
|
||||
return miBreakpoint.isTemporary();
|
||||
}
|
||||
return (type == ICDIBreakpoint.TEMPORARY);
|
||||
}
|
||||
|
||||
|
@ -115,12 +122,15 @@ public class Breakpoint extends CObject implements ICDILocationBreakpoint {
|
|||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpoint#setEnabled(boolean)
|
||||
*/
|
||||
public void setEnabled(boolean enable) throws CDIException {
|
||||
if (enable == false && isEnabled() == true) {
|
||||
public void setEnabled(boolean on) throws CDIException {
|
||||
if (miBreakpoint != null) {
|
||||
if (on == false && isEnabled() == true) {
|
||||
mgr.disableBreakpoint(this);
|
||||
} else if (enable == true && isEnabled() == false) {
|
||||
} else if (on == true && isEnabled() == false) {
|
||||
mgr.enableBreakpoint(this);
|
||||
}
|
||||
}
|
||||
enable = on;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -128,11 +138,12 @@ public class Breakpoint extends CObject implements ICDILocationBreakpoint {
|
|||
*/
|
||||
public ICDILocation getLocation() throws CDIException {
|
||||
if (location == null) {
|
||||
if (miBreakpoint != null)
|
||||
if (miBreakpoint != null) {
|
||||
location = new Location (miBreakpoint.getFile(),
|
||||
miBreakpoint.getFunction(),
|
||||
miBreakpoint.getLine(),
|
||||
miBreakpoint.getAddress());
|
||||
}
|
||||
}
|
||||
return location;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue