mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
2005-05-16 Alain Magloire
Fix PR 91975 * cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java
This commit is contained in:
parent
5fa9743d78
commit
331061538a
2 changed files with 42 additions and 9 deletions
|
@ -1,3 +1,7 @@
|
|||
2005-05-16 Alain Magloire
|
||||
Fix PR 91975
|
||||
* cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java
|
||||
|
||||
2005-05-12 Alain Magloire
|
||||
Fix PR 94841
|
||||
* cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java
|
||||
|
|
|
@ -196,6 +196,16 @@ public class BreakpointManager extends Manager {
|
|||
*/
|
||||
public void enableBreakpoint(Breakpoint breakpoint) throws CDIException {
|
||||
Target target = (Target)breakpoint.getTarget();
|
||||
|
||||
// Check if the breakpoint is in the deffered list
|
||||
List dList = (List)deferredMap.get(target);
|
||||
if (dList != null) {
|
||||
if (dList.contains(breakpoint)) {
|
||||
breakpoint.setEnabled0(true);
|
||||
return; // bail out here, our work is done.
|
||||
}
|
||||
}
|
||||
|
||||
List bList = (List)breakMap.get(target);
|
||||
if (bList == null) {
|
||||
throw new CDIException(CdiResources.getString("cdi.BreakpointManager.Not_a_CDT_breakpoint")); //$NON-NLS-1$
|
||||
|
@ -244,6 +254,16 @@ public class BreakpointManager extends Manager {
|
|||
*/
|
||||
public void disableBreakpoint(Breakpoint breakpoint) throws CDIException {
|
||||
Target target = (Target)breakpoint.getTarget();
|
||||
|
||||
// Check if the breakpoint is in the deffered list
|
||||
List dList = (List)deferredMap.get(target);
|
||||
if (dList != null) {
|
||||
if (dList.contains(breakpoint)) {
|
||||
breakpoint.setEnabled0(false);
|
||||
return; // bail out here, our work is done.
|
||||
}
|
||||
}
|
||||
|
||||
List bList = (List)breakMap.get(target);
|
||||
if (bList == null) {
|
||||
throw new CDIException(CdiResources.getString("cdi.BreakpointManager.Not_a_CDT_breakpoint")); //$NON-NLS-1$
|
||||
|
@ -293,8 +313,18 @@ public class BreakpointManager extends Manager {
|
|||
* @param newCondition
|
||||
* @throws CDIException
|
||||
*/
|
||||
public void setCondition(ICDIBreakpoint breakpoint, ICDICondition newCondition) throws CDIException {
|
||||
public void setCondition(Breakpoint breakpoint, ICDICondition newCondition) throws CDIException {
|
||||
Target target = (Target)breakpoint.getTarget();
|
||||
|
||||
// Check if the breakpoint is in the deffered list
|
||||
List dList = (List)deferredMap.get(target);
|
||||
if (dList != null) {
|
||||
if (dList.contains(breakpoint)) {
|
||||
breakpoint.setCondition0(newCondition);
|
||||
return; // bail out here, our work is done.
|
||||
}
|
||||
}
|
||||
|
||||
List bList = (List)breakMap.get(target);
|
||||
if (bList == null) {
|
||||
throw new CDIException(CdiResources.getString("cdi.BreakpointManager.Not_a_CDT_breakpoint")); //$NON-NLS-1$
|
||||
|
@ -303,15 +333,14 @@ public class BreakpointManager extends Manager {
|
|||
throw new CDIException(CdiResources.getString("cdi.BreakpointManager.Not_a_CDT_breakpoint")); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
Breakpoint bpt = (Breakpoint)breakpoint;
|
||||
MIBreakpoint[] miBreakpoints = bpt.getMIBreakpoints();
|
||||
MIBreakpoint[] miBreakpoints = breakpoint.getMIBreakpoints();
|
||||
deleteMIBreakpoints(target, miBreakpoints);
|
||||
ICDICondition oldCondition = bpt.getCondition();
|
||||
ICDICondition oldCondition = breakpoint.getCondition();
|
||||
boolean success = false;
|
||||
try {
|
||||
bpt.setCondition0(newCondition);
|
||||
breakpoint.setCondition0(newCondition);
|
||||
if (breakpoint instanceof LocationBreakpoint) {
|
||||
setLocationBreakpoint((LocationBreakpoint)bpt);
|
||||
setLocationBreakpoint((LocationBreakpoint)breakpoint);
|
||||
} else if (breakpoint instanceof Watchpoint) {
|
||||
setWatchpoint((Watchpoint)breakpoint);
|
||||
} else {
|
||||
|
@ -320,9 +349,9 @@ public class BreakpointManager extends Manager {
|
|||
success = true;
|
||||
} finally {
|
||||
if (!success) {
|
||||
bpt.setCondition0(oldCondition);
|
||||
breakpoint.setCondition0(oldCondition);
|
||||
if (breakpoint instanceof LocationBreakpoint) {
|
||||
setLocationBreakpoint((LocationBreakpoint)bpt);
|
||||
setLocationBreakpoint((LocationBreakpoint)breakpoint);
|
||||
} else if (breakpoint instanceof Watchpoint) {
|
||||
setWatchpoint((Watchpoint)breakpoint);
|
||||
}
|
||||
|
@ -330,7 +359,7 @@ public class BreakpointManager extends Manager {
|
|||
}
|
||||
|
||||
// Fire a changed Event.
|
||||
miBreakpoints = bpt.getMIBreakpoints();
|
||||
miBreakpoints = breakpoint.getMIBreakpoints();
|
||||
if (miBreakpoints != null && miBreakpoints.length > 0) {
|
||||
MISession miSession = target.getMISession();
|
||||
miSession.fireEvent(new MIBreakpointChangedEvent(miSession, miBreakpoints[0].getNumber()));
|
||||
|
|
Loading…
Add table
Reference in a new issue