mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
BreakPoint changed to Breakpoint
This commit is contained in:
parent
51bb0fb29c
commit
b8e4508478
19 changed files with 152 additions and 117 deletions
|
@ -6,7 +6,7 @@
|
||||||
package org.eclipse.cdt.debug.mi.core;
|
package org.eclipse.cdt.debug.mi.core;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.mi.core.command.CLICommand;
|
import org.eclipse.cdt.debug.mi.core.command.CLICommand;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIBreakPointChangedEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointChangedEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIRunningEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIRunningEvent;
|
||||||
|
|
||||||
|
@ -44,10 +44,12 @@ public class CLIProcessor {
|
||||||
session.getMIInferior().setRunning();
|
session.getMIInferior().setRunning();
|
||||||
MIEvent event = new MIRunningEvent(cmd.getToken(), type);
|
MIEvent event = new MIRunningEvent(cmd.getToken(), type);
|
||||||
session.fireEvent(event);
|
session.fireEvent(event);
|
||||||
} else if (isSettingBreakpoint(operation)) {
|
} else if (isSettingBreakpoint(operation) ||
|
||||||
session.fireEvent(new MIBreakPointChangedEvent(0));
|
isSettingWatchpoint(operation) ||
|
||||||
} else if (isSettingWatchpoint(operation)) {
|
isDeletingBreakpoint(operation)) {
|
||||||
} else if (isDeletingBreakpoint(operation)) {
|
// We know something change, we just do not know what.
|
||||||
|
// So the easiest way is to let the top layer handle it.
|
||||||
|
session.fireEvent(new MIBreakpointChangedEvent(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ import org.eclipse.cdt.debug.mi.core.command.MIExecNextInstruction;
|
||||||
import org.eclipse.cdt.debug.mi.core.command.MIExecStep;
|
import org.eclipse.cdt.debug.mi.core.command.MIExecStep;
|
||||||
import org.eclipse.cdt.debug.mi.core.command.MIExecStepInstruction;
|
import org.eclipse.cdt.debug.mi.core.command.MIExecStepInstruction;
|
||||||
import org.eclipse.cdt.debug.mi.core.command.MIExecUntil;
|
import org.eclipse.cdt.debug.mi.core.command.MIExecUntil;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointHitEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIErrorEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIErrorEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIFunctionFinishedEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIFunctionFinishedEvent;
|
||||||
|
@ -324,9 +324,9 @@ public class RxThread extends Thread {
|
||||||
MIEvent event = null;
|
MIEvent event = null;
|
||||||
if ("breakpoint-hit".equals(reason)) {
|
if ("breakpoint-hit".equals(reason)) {
|
||||||
if (exec != null) {
|
if (exec != null) {
|
||||||
event = new MIBreakpointEvent(exec);
|
event = new MIBreakpointHitEvent(exec);
|
||||||
} else if (rr != null) {
|
} else if (rr != null) {
|
||||||
event = new MIBreakpointEvent(rr);
|
event = new MIBreakpointHitEvent(rr);
|
||||||
}
|
}
|
||||||
session.getMIInferior().setSuspended();
|
session.getMIInferior().setSuspended();
|
||||||
} else if ("watchpoint-trigger".equals(reason) ||
|
} else if ("watchpoint-trigger".equals(reason) ||
|
||||||
|
|
|
@ -8,7 +8,7 @@ import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||||
import org.eclipse.cdt.debug.core.cdi.ICDICondition;
|
import org.eclipse.cdt.debug.core.cdi.ICDICondition;
|
||||||
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
|
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint;
|
||||||
import org.eclipse.cdt.debug.mi.core.output.MIBreakPoint;
|
import org.eclipse.cdt.debug.mi.core.output.MIBreakpoint;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
|
@ -16,17 +16,17 @@ public class Breakpoint extends CObject implements ICDILocationBreakpoint {
|
||||||
|
|
||||||
ICDILocation location;
|
ICDILocation location;
|
||||||
ICDICondition condition;
|
ICDICondition condition;
|
||||||
MIBreakPoint miBreakPoint;
|
MIBreakpoint miBreakpoint;
|
||||||
BreakpointManager mgr;
|
BreakpointManager mgr;
|
||||||
|
|
||||||
public Breakpoint(BreakpointManager m, MIBreakPoint miBreak) {
|
public Breakpoint(BreakpointManager m, MIBreakpoint miBreak) {
|
||||||
super(m.getCSession().getCTarget());
|
super(m.getCSession().getCTarget());
|
||||||
miBreakPoint = miBreak;
|
miBreakpoint = miBreak;
|
||||||
mgr = m;
|
mgr = m;
|
||||||
}
|
}
|
||||||
|
|
||||||
MIBreakPoint getMIBreakPoint() {
|
MIBreakpoint getMIBreakpoint() {
|
||||||
return miBreakPoint;
|
return miBreakpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,8 +34,8 @@ public class Breakpoint extends CObject implements ICDILocationBreakpoint {
|
||||||
*/
|
*/
|
||||||
public ICDICondition getCondition() throws CDIException {
|
public ICDICondition getCondition() throws CDIException {
|
||||||
if (condition == null) {
|
if (condition == null) {
|
||||||
condition = new Condition(miBreakPoint.getIgnoreCount(),
|
condition = new Condition(miBreakpoint.getIgnoreCount(),
|
||||||
miBreakPoint.getWhat());
|
miBreakpoint.getWhat());
|
||||||
}
|
}
|
||||||
return condition;
|
return condition;
|
||||||
}
|
}
|
||||||
|
@ -44,28 +44,28 @@ public class Breakpoint extends CObject implements ICDILocationBreakpoint {
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpoint#getThreadId()
|
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpoint#getThreadId()
|
||||||
*/
|
*/
|
||||||
public String getThreadId() throws CDIException {
|
public String getThreadId() throws CDIException {
|
||||||
return miBreakPoint.getThreadId();
|
return miBreakpoint.getThreadId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpoint#isEnabled()
|
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpoint#isEnabled()
|
||||||
*/
|
*/
|
||||||
public boolean isEnabled() throws CDIException {
|
public boolean isEnabled() throws CDIException {
|
||||||
return miBreakPoint.isEnabled();
|
return miBreakpoint.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpoint#isHardware()
|
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpoint#isHardware()
|
||||||
*/
|
*/
|
||||||
public boolean isHardware() {
|
public boolean isHardware() {
|
||||||
return miBreakPoint.isHardware();
|
return miBreakpoint.isHardware();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpoint#isTemporary()
|
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpoint#isTemporary()
|
||||||
*/
|
*/
|
||||||
public boolean isTemporary() {
|
public boolean isTemporary() {
|
||||||
return miBreakPoint.isTemporary();
|
return miBreakpoint.isTemporary();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -94,10 +94,10 @@ public class Breakpoint extends CObject implements ICDILocationBreakpoint {
|
||||||
*/
|
*/
|
||||||
public ICDILocation getLocation() throws CDIException {
|
public ICDILocation getLocation() throws CDIException {
|
||||||
if (location == null) {
|
if (location == null) {
|
||||||
location = new Location (miBreakPoint.getFile(),
|
location = new Location (miBreakpoint.getFile(),
|
||||||
miBreakPoint.getFunction(),
|
miBreakpoint.getFunction(),
|
||||||
miBreakPoint.getLine(),
|
miBreakpoint.getLine(),
|
||||||
miBreakPoint.getAddress());
|
miBreakpoint.getAddress());
|
||||||
}
|
}
|
||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,15 +7,15 @@ package org.eclipse.cdt.debug.mi.core.cdi;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointHit;
|
import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointHit;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointHitEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public class BreakpointHit extends SessionObject implements ICDIBreakpointHit {
|
public class BreakpointHit extends SessionObject implements ICDIBreakpointHit {
|
||||||
|
|
||||||
MIBreakpointEvent breakEvent;
|
MIBreakpointHitEvent breakEvent;
|
||||||
|
|
||||||
public BreakpointHit(CSession session, MIBreakpointEvent e) {
|
public BreakpointHit(CSession session, MIBreakpointHitEvent e) {
|
||||||
super(session);
|
super(session);
|
||||||
breakEvent = e;
|
breakEvent = e;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,18 +28,18 @@ import org.eclipse.cdt.debug.mi.core.command.MIBreakEnable;
|
||||||
import org.eclipse.cdt.debug.mi.core.command.MIBreakInsert;
|
import org.eclipse.cdt.debug.mi.core.command.MIBreakInsert;
|
||||||
import org.eclipse.cdt.debug.mi.core.command.MIBreakList;
|
import org.eclipse.cdt.debug.mi.core.command.MIBreakList;
|
||||||
import org.eclipse.cdt.debug.mi.core.command.MIBreakWatch;
|
import org.eclipse.cdt.debug.mi.core.command.MIBreakWatch;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIBreakPointChangedEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointChangedEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIBreakPointCreatedEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointCreatedEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIBreakPointDeletedEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointDeletedEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.output.MIBreakInsertInfo;
|
import org.eclipse.cdt.debug.mi.core.output.MIBreakInsertInfo;
|
||||||
import org.eclipse.cdt.debug.mi.core.output.MIBreakListInfo;
|
import org.eclipse.cdt.debug.mi.core.output.MIBreakListInfo;
|
||||||
import org.eclipse.cdt.debug.mi.core.output.MIBreakPoint;
|
import org.eclipse.cdt.debug.mi.core.output.MIBreakpoint;
|
||||||
import org.eclipse.cdt.debug.mi.core.output.MIBreakWatchInfo;
|
import org.eclipse.cdt.debug.mi.core.output.MIBreakWatchInfo;
|
||||||
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
|
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Breakpoint Manager for the CDI interface.
|
||||||
*/
|
*/
|
||||||
public class BreakpointManager extends SessionObject implements ICDIBreakpointManager {
|
public class BreakpointManager extends SessionObject implements ICDIBreakpointManager {
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
|
||||||
allowInterrupt = true;
|
allowInterrupt = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MIBreakPoint[] getMIBreakpoints() throws CDIException {
|
public MIBreakpoint[] getMIBreakpoints() throws CDIException {
|
||||||
CSession s = getCSession();
|
CSession s = getCSession();
|
||||||
CommandFactory factory = s.getMISession().getCommandFactory();
|
CommandFactory factory = s.getMISession().getCommandFactory();
|
||||||
MIBreakList breakpointList = factory.createMIBreakList();
|
MIBreakList breakpointList = factory.createMIBreakList();
|
||||||
|
@ -64,35 +64,39 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
throw new CDIException("No answer");
|
throw new CDIException("No answer");
|
||||||
}
|
}
|
||||||
return info.getBreakPoints();
|
return info.getMIBreakpoints();
|
||||||
} catch (MIException e) {
|
} catch (MIException e) {
|
||||||
throw new MI2CDIException(e);
|
throw new MI2CDIException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void update() throws CDIException {
|
void update() throws CDIException {
|
||||||
MIBreakPoint[] newMIBreakPoints = getMIBreakpoints();
|
MIBreakpoint[] newMIBreakpoints = getMIBreakpoints();
|
||||||
List eventList = new ArrayList(newMIBreakPoints.length);
|
List eventList = new ArrayList(newMIBreakpoints.length);
|
||||||
for (int i = 0; i < newMIBreakPoints.length; i++) {
|
for (int i = 0; i < newMIBreakpoints.length; i++) {
|
||||||
int no = newMIBreakPoints[i].getNumber();
|
int no = newMIBreakpoints[i].getNumber();
|
||||||
if (containsBreakpoint(no)) {
|
if (containsBreakpoint(no)) {
|
||||||
if (hasBreakpointChanged(newMIBreakPoints[i])) {
|
if (hasBreakpointChanged(newMIBreakpoints[i])) {
|
||||||
// Fire ChangedEvent
|
// Fire ChangedEvent
|
||||||
eventList.add(new MIBreakPointChangedEvent(no));
|
eventList.add(new MIBreakpointChangedEvent(no));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// add the new breakpoint and fire create event
|
// add the new breakpoint and fire CreatedEvent
|
||||||
breakList.add(new Breakpoint(this, newMIBreakPoints[i]));
|
if (newMIBreakpoints[i].isWatchpoint()) {
|
||||||
eventList.add(new MIBreakPointCreatedEvent(no));
|
breakList.add(new Watchpoint(this, newMIBreakpoints[i]));
|
||||||
|
} else {
|
||||||
|
breakList.add(new Breakpoint(this, newMIBreakpoints[i]));
|
||||||
|
}
|
||||||
|
eventList.add(new MIBreakpointCreatedEvent(no));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Check if any breakpoint was removed.
|
// Check if any breakpoint was removed.
|
||||||
Breakpoint[] oldBreakpoints = listBreakpoints();
|
Breakpoint[] oldBreakpoints = listBreakpoints();
|
||||||
for (int i = 0; i < oldBreakpoints.length; i++) {
|
for (int i = 0; i < oldBreakpoints.length; i++) {
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
int no = oldBreakpoints[i].getMIBreakPoint().getNumber();
|
int no = oldBreakpoints[i].getMIBreakpoint().getNumber();
|
||||||
for (int j = 0; j < newMIBreakPoints.length; j++) {
|
for (int j = 0; j < newMIBreakpoints.length; j++) {
|
||||||
if (no == newMIBreakPoints[i].getNumber()) {
|
if (no == newMIBreakpoints[i].getNumber()) {
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -101,7 +105,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
|
||||||
// Fire destroyed Events.
|
// Fire destroyed Events.
|
||||||
breakList.remove(oldBreakpoints[i]);
|
breakList.remove(oldBreakpoints[i]);
|
||||||
delList.add(oldBreakpoints[i]);
|
delList.add(oldBreakpoints[i]);
|
||||||
eventList.add(new MIBreakPointDeletedEvent(no));
|
eventList.add(new MIBreakpointDeletedEvent(no));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MISession mi = getCSession().getMISession();
|
MISession mi = getCSession().getMISession();
|
||||||
|
@ -113,7 +117,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
|
||||||
return (getBreakpoint(number) != null);
|
return (getBreakpoint(number) != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean hasBreakpointChanged(MIBreakPoint miBreakPoint) {
|
boolean hasBreakpointChanged(MIBreakpoint miBreakpoint) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +126,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
|
||||||
for (int i = 0; i < bkpts.length; i++) {
|
for (int i = 0; i < bkpts.length; i++) {
|
||||||
if (bkpts[i] instanceof Breakpoint) {
|
if (bkpts[i] instanceof Breakpoint) {
|
||||||
Breakpoint point = (Breakpoint) bkpts[i];
|
Breakpoint point = (Breakpoint) bkpts[i];
|
||||||
MIBreakPoint miBreak = point.getMIBreakPoint();
|
MIBreakpoint miBreak = point.getMIBreakpoint();
|
||||||
if (miBreak.getNumber() == number) {
|
if (miBreak.getNumber() == number) {
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -194,7 +198,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
|
||||||
if (breakpoints[i] instanceof Breakpoint
|
if (breakpoints[i] instanceof Breakpoint
|
||||||
&& breakList.contains(breakpoints[i])) {
|
&& breakList.contains(breakpoints[i])) {
|
||||||
numbers[i] =
|
numbers[i] =
|
||||||
((Breakpoint) breakpoints[i]).getMIBreakPoint().getNumber();
|
((Breakpoint) breakpoints[i]).getMIBreakpoint().getNumber();
|
||||||
} else {
|
} else {
|
||||||
throw new CDIException("Not a CDT breakpoint");
|
throw new CDIException("Not a CDT breakpoint");
|
||||||
}
|
}
|
||||||
|
@ -218,8 +222,8 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
|
||||||
for (int i = 0; i < breakpoints.length; i++) {
|
for (int i = 0; i < breakpoints.length; i++) {
|
||||||
breakList.remove(breakpoints[i]);
|
breakList.remove(breakpoints[i]);
|
||||||
delList.add(breakpoints[i]);
|
delList.add(breakpoints[i]);
|
||||||
int no = ((Breakpoint)breakpoints[i]).getMIBreakPoint().getNumber();
|
int no = ((Breakpoint)breakpoints[i]).getMIBreakpoint().getNumber();
|
||||||
eventList.add(new MIBreakPointDeletedEvent(no));
|
eventList.add(new MIBreakpointDeletedEvent(no));
|
||||||
}
|
}
|
||||||
MISession mi = s.getMISession();
|
MISession mi = s.getMISession();
|
||||||
MIEvent[] events = (MIEvent[])eventList.toArray(new MIEvent[0]);
|
MIEvent[] events = (MIEvent[])eventList.toArray(new MIEvent[0]);
|
||||||
|
@ -230,7 +234,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
|
||||||
Breakpoint point = null;
|
Breakpoint point = null;
|
||||||
Breakpoint[] points = (Breakpoint[])delList.toArray(new Breakpoint[delList.size()]);
|
Breakpoint[] points = (Breakpoint[])delList.toArray(new Breakpoint[delList.size()]);
|
||||||
for (int i = 0; i < points.length; i++) {
|
for (int i = 0; i < points.length; i++) {
|
||||||
if (points[i].getMIBreakPoint().getNumber() == no) {
|
if (points[i].getMIBreakpoint().getNumber() == no) {
|
||||||
delList.remove(points[i]);
|
delList.remove(points[i]);
|
||||||
point = points[i];
|
point = points[i];
|
||||||
break;
|
break;
|
||||||
|
@ -243,7 +247,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
|
||||||
int number = 0;
|
int number = 0;
|
||||||
if (breakpoint instanceof Breakpoint
|
if (breakpoint instanceof Breakpoint
|
||||||
&& breakList.contains(breakpoint)) {
|
&& breakList.contains(breakpoint)) {
|
||||||
number = ((Breakpoint) breakpoint).getMIBreakPoint().getNumber();
|
number = ((Breakpoint) breakpoint).getMIBreakpoint().getNumber();
|
||||||
} else {
|
} else {
|
||||||
throw new CDIException("Not a CDT breakpoint");
|
throw new CDIException("Not a CDT breakpoint");
|
||||||
}
|
}
|
||||||
|
@ -264,14 +268,14 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
|
||||||
// Resume the program and enable events.
|
// Resume the program and enable events.
|
||||||
resumeInferior(state);
|
resumeInferior(state);
|
||||||
}
|
}
|
||||||
((Breakpoint) breakpoint).getMIBreakPoint().setEnabled(true);
|
((Breakpoint) breakpoint).getMIBreakpoint().setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disableBreakpoint(ICDIBreakpoint breakpoint) throws CDIException {
|
public void disableBreakpoint(ICDIBreakpoint breakpoint) throws CDIException {
|
||||||
int number = 0;
|
int number = 0;
|
||||||
if (breakpoint instanceof Breakpoint
|
if (breakpoint instanceof Breakpoint
|
||||||
&& breakList.contains(breakpoint)) {
|
&& breakList.contains(breakpoint)) {
|
||||||
number = ((Breakpoint) breakpoint).getMIBreakPoint().getNumber();
|
number = ((Breakpoint) breakpoint).getMIBreakpoint().getNumber();
|
||||||
} else {
|
} else {
|
||||||
throw new CDIException("Not a CDT breakpoint");
|
throw new CDIException("Not a CDT breakpoint");
|
||||||
}
|
}
|
||||||
|
@ -291,14 +295,14 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
|
||||||
} finally {
|
} finally {
|
||||||
resumeInferior(state);
|
resumeInferior(state);
|
||||||
}
|
}
|
||||||
((Breakpoint) breakpoint).getMIBreakPoint().setEnabled(false);
|
((Breakpoint) breakpoint).getMIBreakpoint().setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCondition(ICDIBreakpoint breakpoint, ICDICondition condition) throws CDIException {
|
public void setCondition(ICDIBreakpoint breakpoint, ICDICondition condition) throws CDIException {
|
||||||
int number = 0;
|
int number = 0;
|
||||||
if (breakpoint instanceof Breakpoint
|
if (breakpoint instanceof Breakpoint
|
||||||
&& breakList.contains(breakpoint)) {
|
&& breakList.contains(breakpoint)) {
|
||||||
number = ((Breakpoint) breakpoint).getMIBreakPoint().getNumber();
|
number = ((Breakpoint) breakpoint).getMIBreakpoint().getNumber();
|
||||||
} else {
|
} else {
|
||||||
throw new CDIException("Not a CDT breakpoint");
|
throw new CDIException("Not a CDT breakpoint");
|
||||||
}
|
}
|
||||||
|
@ -360,7 +364,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
|
||||||
// if (info == null) {
|
// if (info == null) {
|
||||||
// throw new CDIException("No answer");
|
// throw new CDIException("No answer");
|
||||||
// }
|
// }
|
||||||
// MIBreakPoint[] miPoints = info.getBreakPoints();
|
// MIBreakpoint[] mipoints = info.getBreakpoints();
|
||||||
// for (int i = 0; i < miPoints.length; i++) {
|
// for (int i = 0; i < miPoints.length; i++) {
|
||||||
// if (!containsBreakpoint(miPoints[i].getNumber())) {
|
// if (!containsBreakpoint(miPoints[i].getNumber())) {
|
||||||
// // FIXME: Generate a Create/Change Event??
|
// // FIXME: Generate a Create/Change Event??
|
||||||
|
@ -423,14 +427,14 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
|
||||||
MIBreakInsert breakInsert =
|
MIBreakInsert breakInsert =
|
||||||
factory.createMIBreakInsert( temporary, hardware, exprCond,
|
factory.createMIBreakInsert( temporary, hardware, exprCond,
|
||||||
ignoreCount, line.toString());
|
ignoreCount, line.toString());
|
||||||
MIBreakPoint[] points = null;
|
MIBreakpoint[] points = null;
|
||||||
try {
|
try {
|
||||||
s.getMISession().postCommand(breakInsert);
|
s.getMISession().postCommand(breakInsert);
|
||||||
MIBreakInsertInfo info = breakInsert.getMIBreakInsertInfo();
|
MIBreakInsertInfo info = breakInsert.getMIBreakInsertInfo();
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
throw new CDIException("No answer");
|
throw new CDIException("No answer");
|
||||||
}
|
}
|
||||||
points = info.getBreakPoints();
|
points = info.getMIBreakpoints();
|
||||||
if (points == null || points.length == 0) {
|
if (points == null || points.length == 0) {
|
||||||
throw new CDIException("Error parsing");
|
throw new CDIException("Error parsing");
|
||||||
}
|
}
|
||||||
|
@ -441,6 +445,10 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
|
||||||
}
|
}
|
||||||
Breakpoint bkpt = new Breakpoint(this, points[0]);
|
Breakpoint bkpt = new Breakpoint(this, points[0]);
|
||||||
breakList.add(bkpt);
|
breakList.add(bkpt);
|
||||||
|
|
||||||
|
// Fire a created Event.
|
||||||
|
MISession mi = s.getMISession();
|
||||||
|
mi.fireEvent(new MIBreakpointCreatedEvent(bkpt.getMIBreakpoint().getNumber()));
|
||||||
return bkpt;
|
return bkpt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -458,11 +466,11 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
|
||||||
CommandFactory factory = s.getMISession().getCommandFactory();
|
CommandFactory factory = s.getMISession().getCommandFactory();
|
||||||
MIBreakWatch breakWatch =
|
MIBreakWatch breakWatch =
|
||||||
factory.createMIBreakWatch(access, read, expression);
|
factory.createMIBreakWatch(access, read, expression);
|
||||||
MIBreakPoint[] points = null;
|
MIBreakpoint[] points = null;
|
||||||
try {
|
try {
|
||||||
s.getMISession().postCommand(breakWatch);
|
s.getMISession().postCommand(breakWatch);
|
||||||
MIBreakWatchInfo info = breakWatch.getMIBreakWatchInfo();
|
MIBreakWatchInfo info = breakWatch.getMIBreakWatchInfo();
|
||||||
points = info.getBreakPoints();
|
points = info.getMIBreakpoints();
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
throw new CDIException("No answer");
|
throw new CDIException("No answer");
|
||||||
}
|
}
|
||||||
|
@ -476,8 +484,13 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
|
||||||
}
|
}
|
||||||
Watchpoint bkpt = new Watchpoint(this, points[0]);
|
Watchpoint bkpt = new Watchpoint(this, points[0]);
|
||||||
breakList.add(bkpt);
|
breakList.add(bkpt);
|
||||||
|
|
||||||
|
// Fire a created Event.
|
||||||
|
MISession mi = s.getMISession();
|
||||||
|
mi.fireEvent(new MIBreakpointCreatedEvent(bkpt.getMIBreakpoint().getNumber()));
|
||||||
return bkpt;
|
return bkpt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#createCondition(int, String)
|
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#createCondition(int, String)
|
||||||
*/
|
*/
|
||||||
|
@ -499,5 +512,4 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
|
||||||
return new Location(address);
|
return new Location(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@ package org.eclipse.cdt.debug.mi.core.cdi;
|
||||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||||
import org.eclipse.cdt.debug.core.cdi.ICDICatchEvent;
|
import org.eclipse.cdt.debug.core.cdi.ICDICatchEvent;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDICatchpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDICatchpoint;
|
||||||
import org.eclipse.cdt.debug.mi.core.output.MIBreakPoint;
|
import org.eclipse.cdt.debug.mi.core.output.MIBreakpoint;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public class Catchpoint extends Breakpoint implements ICDICatchpoint {
|
public class Catchpoint extends Breakpoint implements ICDICatchpoint {
|
||||||
|
|
||||||
public Catchpoint(BreakpointManager m, MIBreakPoint miBreak) {
|
public Catchpoint(BreakpointManager m, MIBreakpoint miBreak) {
|
||||||
super(m, miBreak);
|
super(m, miBreak);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||||
import org.eclipse.cdt.debug.core.cdi.event.ICDIChangedEvent;
|
import org.eclipse.cdt.debug.core.cdi.event.ICDIChangedEvent;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIBreakPointChangedEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointChangedEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIRegisterChangedEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIRegisterChangedEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIVarChangedEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIVarChangedEvent;
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ public class ChangedEvent implements ICDIChangedEvent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChangedEvent(CSession s, MIBreakPointChangedEvent bpoint) {
|
public ChangedEvent(CSession s, MIBreakpointChangedEvent bpoint) {
|
||||||
session = s;
|
session = s;
|
||||||
BreakpointManager mgr = (BreakpointManager)session.getBreakpointManager();
|
BreakpointManager mgr = (BreakpointManager)session.getBreakpointManager();
|
||||||
int number = bpoint.getNumber();
|
int number = bpoint.getNumber();
|
||||||
|
|
|
@ -7,7 +7,7 @@ package org.eclipse.cdt.debug.mi.core.cdi;
|
||||||
import org.eclipse.cdt.debug.core.cdi.event.ICDICreatedEvent;
|
import org.eclipse.cdt.debug.core.cdi.event.ICDICreatedEvent;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIBreakPointCreatedEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointCreatedEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
|
@ -16,7 +16,7 @@ public class CreatedEvent implements ICDICreatedEvent {
|
||||||
CSession session;
|
CSession session;
|
||||||
ICDIObject source;
|
ICDIObject source;
|
||||||
|
|
||||||
public CreatedEvent(CSession s, MIBreakPointCreatedEvent bpoint) {
|
public CreatedEvent(CSession s, MIBreakpointCreatedEvent bpoint) {
|
||||||
session = s;
|
session = s;
|
||||||
BreakpointManager mgr = (BreakpointManager)session.getBreakpointManager();
|
BreakpointManager mgr = (BreakpointManager)session.getBreakpointManager();
|
||||||
int number = bpoint.getNumber();
|
int number = bpoint.getNumber();
|
||||||
|
|
|
@ -7,7 +7,7 @@ package org.eclipse.cdt.debug.mi.core.cdi;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.cdi.event.ICDIDestroyedEvent;
|
import org.eclipse.cdt.debug.core.cdi.event.ICDIDestroyedEvent;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIBreakPointDeletedEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointDeletedEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIThreadExitEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIThreadExitEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIVarChangedEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIVarChangedEvent;
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ public class DestroyedEvent implements ICDIDestroyedEvent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public DestroyedEvent(CSession s, MIBreakPointDeletedEvent bpoint) {
|
public DestroyedEvent(CSession s, MIBreakpointDeletedEvent bpoint) {
|
||||||
session = s;
|
session = s;
|
||||||
BreakpointManager mgr = (BreakpointManager)session.getBreakpointManager();
|
BreakpointManager mgr = (BreakpointManager)session.getBreakpointManager();
|
||||||
int number = bpoint.getNumber();
|
int number = bpoint.getNumber();
|
||||||
|
|
|
@ -15,9 +15,9 @@ import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||||
import org.eclipse.cdt.debug.core.cdi.ICDIEventManager;
|
import org.eclipse.cdt.debug.core.cdi.ICDIEventManager;
|
||||||
import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent;
|
import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent;
|
||||||
import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener;
|
import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIBreakPointChangedEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointChangedEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIBreakPointCreatedEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointCreatedEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIBreakPointDeletedEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointDeletedEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIChangedEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIChangedEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MICreatedEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MICreatedEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIDestroyedEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIDestroyedEvent;
|
||||||
|
@ -81,12 +81,13 @@ public class EventManager extends SessionObject implements ICDIEventManager, Obs
|
||||||
blocks[i].setDirty(false);
|
blocks[i].setDirty(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (miEvent instanceof MIBreakPointChangedEvent) {
|
} else if (miEvent instanceof MIBreakpointChangedEvent) {
|
||||||
MIBreakPointChangedEvent bpoint = (MIBreakPointChangedEvent)miEvent;
|
MIBreakpointChangedEvent bpoint = (MIBreakpointChangedEvent)miEvent;
|
||||||
if (bpoint.getNumber() > 0) {
|
if (bpoint.getNumber() > 0) {
|
||||||
cdiList.add(new ChangedEvent(session, (MIBreakPointChangedEvent)miEvent));
|
cdiList.add(new ChangedEvent(session, bpoint));
|
||||||
} else {
|
} else {
|
||||||
// Try to update to figure out what have change.
|
// Something change we do not know what
|
||||||
|
// Let the breakpoint manager handle it with an update().
|
||||||
try {
|
try {
|
||||||
((BreakpointManager)(session.getBreakpointManager())).update();
|
((BreakpointManager)(session.getBreakpointManager())).update();
|
||||||
} catch (CDIException e) {
|
} catch (CDIException e) {
|
||||||
|
@ -102,12 +103,32 @@ public class EventManager extends SessionObject implements ICDIEventManager, Obs
|
||||||
cdiList.add(new DestroyedEvent(session));
|
cdiList.add(new DestroyedEvent(session));
|
||||||
} else if (miEvent instanceof MIDetachedEvent) {
|
} else if (miEvent instanceof MIDetachedEvent) {
|
||||||
cdiList.add(new DisconnectedEvent(session));
|
cdiList.add(new DisconnectedEvent(session));
|
||||||
} else if (miEvent instanceof MIBreakPointDeletedEvent) {
|
} else if (miEvent instanceof MIBreakpointDeletedEvent) {
|
||||||
cdiList.add(new DestroyedEvent(session, (MIBreakPointDeletedEvent)miEvent));
|
MIBreakpointDeletedEvent bpoint = (MIBreakpointDeletedEvent)miEvent;
|
||||||
|
if (bpoint.getNumber() > 0) {
|
||||||
|
cdiList.add(new DestroyedEvent(session, bpoint));
|
||||||
|
} else {
|
||||||
|
// Something was deleted we do not know what
|
||||||
|
// Let the breakpoint manager handle it with an update().
|
||||||
|
try {
|
||||||
|
((BreakpointManager)(session.getBreakpointManager())).update();
|
||||||
|
} catch (CDIException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (miEvent instanceof MICreatedEvent) {
|
} else if (miEvent instanceof MICreatedEvent) {
|
||||||
if (miEvent instanceof MIBreakPointCreatedEvent) {
|
if (miEvent instanceof MIBreakpointCreatedEvent) {
|
||||||
cdiList.add(new CreatedEvent(session, (MIBreakPointCreatedEvent)miEvent));
|
MIBreakpointCreatedEvent bpoint = (MIBreakpointCreatedEvent)miEvent;
|
||||||
|
if (bpoint.getNumber() > 0) {
|
||||||
|
cdiList.add(new CreatedEvent(session, bpoint));
|
||||||
|
} else {
|
||||||
|
// Something created we do not know what
|
||||||
|
// Let the breakpoint manager handle it with an update().
|
||||||
|
try {
|
||||||
|
((BreakpointManager)(session.getBreakpointManager())).update();
|
||||||
|
} catch (CDIException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ package org.eclipse.cdt.debug.mi.core.cdi;
|
||||||
import org.eclipse.cdt.debug.core.cdi.ICDISessionObject;
|
import org.eclipse.cdt.debug.core.cdi.ICDISessionObject;
|
||||||
import org.eclipse.cdt.debug.core.cdi.event.ICDISuspendedEvent;
|
import org.eclipse.cdt.debug.core.cdi.event.ICDISuspendedEvent;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointHitEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIErrorEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIErrorEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIFunctionFinishedEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIFunctionFinishedEvent;
|
||||||
|
@ -32,8 +32,8 @@ public class SuspendedEvent implements ICDISuspendedEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICDISessionObject getReason() {
|
public ICDISessionObject getReason() {
|
||||||
if (event instanceof MIBreakpointEvent) {
|
if (event instanceof MIBreakpointHitEvent) {
|
||||||
return new BreakpointHit(session, (MIBreakpointEvent)event);
|
return new BreakpointHit(session, (MIBreakpointHitEvent)event);
|
||||||
} else if (event instanceof MIWatchpointTriggerEvent) {
|
} else if (event instanceof MIWatchpointTriggerEvent) {
|
||||||
return new WatchpointTrigger(session, (MIWatchpointTriggerEvent)event);
|
return new WatchpointTrigger(session, (MIWatchpointTriggerEvent)event);
|
||||||
} else if (event instanceof MIWatchpointScopeEvent) {
|
} else if (event instanceof MIWatchpointScopeEvent) {
|
||||||
|
|
|
@ -7,13 +7,13 @@ package org.eclipse.cdt.debug.mi.core.cdi;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint;
|
||||||
import org.eclipse.cdt.debug.mi.core.output.MIBreakPoint;
|
import org.eclipse.cdt.debug.mi.core.output.MIBreakpoint;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public class Watchpoint extends Breakpoint implements ICDIWatchpoint {
|
public class Watchpoint extends Breakpoint implements ICDIWatchpoint {
|
||||||
|
|
||||||
public Watchpoint(BreakpointManager m, MIBreakPoint miBreak) {
|
public Watchpoint(BreakpointManager m, MIBreakpoint miBreak) {
|
||||||
super(m, miBreak);
|
super(m, miBreak);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,21 +21,21 @@ public class Watchpoint extends Breakpoint implements ICDIWatchpoint {
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.ICDIWatchpoint#getWatchExpression()
|
* @see org.eclipse.cdt.debug.core.cdi.ICDIWatchpoint#getWatchExpression()
|
||||||
*/
|
*/
|
||||||
public String getWatchExpression() throws CDIException {
|
public String getWatchExpression() throws CDIException {
|
||||||
return getMIBreakPoint().getWhat();
|
return getMIBreakpoint().getWhat();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.ICDIWatchpoint#isReadType()
|
* @see org.eclipse.cdt.debug.core.cdi.ICDIWatchpoint#isReadType()
|
||||||
*/
|
*/
|
||||||
public boolean isReadType() {
|
public boolean isReadType() {
|
||||||
return getMIBreakPoint().isReadWatchpoint() || getMIBreakPoint().isAccessWatchpoint();
|
return getMIBreakpoint().isReadWatchpoint() || getMIBreakpoint().isAccessWatchpoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.ICDIWatchpoint#isWriteType()
|
* @see org.eclipse.cdt.debug.core.cdi.ICDIWatchpoint#isWriteType()
|
||||||
*/
|
*/
|
||||||
public boolean isWriteType() {
|
public boolean isWriteType() {
|
||||||
return getMIBreakPoint().isAccessWatchpoint() || getMIBreakPoint().isWriteWatchpoint();
|
return getMIBreakpoint().isAccessWatchpoint() || getMIBreakpoint().isWriteWatchpoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,16 +10,16 @@ package org.eclipse.cdt.debug.mi.core.event;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class MIBreakPointChangedEvent extends MIChangedEvent {
|
public class MIBreakpointChangedEvent extends MIChangedEvent {
|
||||||
|
|
||||||
int no;
|
int no;
|
||||||
|
|
||||||
public MIBreakPointChangedEvent(int number) {
|
public MIBreakpointChangedEvent(int number) {
|
||||||
super(0);
|
super(0);
|
||||||
no = number;
|
no = number;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MIBreakPointChangedEvent(int id, int number) {
|
public MIBreakpointChangedEvent(int id, int number) {
|
||||||
super(id);
|
super(id);
|
||||||
no = number;
|
no = number;
|
||||||
}
|
}
|
|
@ -10,16 +10,16 @@ package org.eclipse.cdt.debug.mi.core.event;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class MIBreakPointCreatedEvent extends MICreatedEvent {
|
public class MIBreakpointCreatedEvent extends MICreatedEvent {
|
||||||
|
|
||||||
int no;
|
int no;
|
||||||
|
|
||||||
public MIBreakPointCreatedEvent(int number) {
|
public MIBreakpointCreatedEvent(int number) {
|
||||||
super(0);
|
super(0);
|
||||||
no = number;
|
no = number;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MIBreakPointCreatedEvent(int id, int number) {
|
public MIBreakpointCreatedEvent(int id, int number) {
|
||||||
super(id);
|
super(id);
|
||||||
no = number;
|
no = number;
|
||||||
}
|
}
|
|
@ -10,16 +10,16 @@ package org.eclipse.cdt.debug.mi.core.event;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class MIBreakPointDeletedEvent extends MIDestroyedEvent {
|
public class MIBreakpointDeletedEvent extends MIDestroyedEvent {
|
||||||
|
|
||||||
int no;
|
int no;
|
||||||
|
|
||||||
public MIBreakPointDeletedEvent(int number) {
|
public MIBreakpointDeletedEvent(int number) {
|
||||||
super(0);
|
super(0);
|
||||||
no = number;
|
no = number;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MIBreakPointDeletedEvent(int id, int number) {
|
public MIBreakpointDeletedEvent(int id, int number) {
|
||||||
super(id);
|
super(id);
|
||||||
no = number;
|
no = number;
|
||||||
}
|
}
|
|
@ -17,17 +17,17 @@ import org.eclipse.cdt.debug.mi.core.output.MIValue;
|
||||||
* ^stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x08048468",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbffff18c"}],file="hello.c",line="4"}
|
* ^stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x08048468",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbffff18c"}],file="hello.c",line="4"}
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class MIBreakpointEvent extends MIStoppedEvent {
|
public class MIBreakpointHitEvent extends MIStoppedEvent {
|
||||||
|
|
||||||
int bkptno;
|
int bkptno;
|
||||||
MIFrame frame;
|
MIFrame frame;
|
||||||
|
|
||||||
public MIBreakpointEvent(MIExecAsyncOutput record) {
|
public MIBreakpointHitEvent(MIExecAsyncOutput record) {
|
||||||
super(record);
|
super(record);
|
||||||
parse();
|
parse();
|
||||||
}
|
}
|
||||||
|
|
||||||
public MIBreakpointEvent(MIResultRecord record) {
|
public MIBreakpointHitEvent(MIResultRecord record) {
|
||||||
super(record);
|
super(record);
|
||||||
parse();
|
parse();
|
||||||
}
|
}
|
|
@ -21,7 +21,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public class MIBreakInsertInfo extends MIInfo {
|
public class MIBreakInsertInfo extends MIInfo {
|
||||||
|
|
||||||
MIBreakPoint[] breakpoints;
|
MIBreakpoint[] breakpoints;
|
||||||
|
|
||||||
void parse() {
|
void parse() {
|
||||||
List aList = new ArrayList(1);
|
List aList = new ArrayList(1);
|
||||||
|
@ -33,27 +33,27 @@ public class MIBreakInsertInfo extends MIInfo {
|
||||||
for (int i = 0; i < results.length; i++) {
|
for (int i = 0; i < results.length; i++) {
|
||||||
String var = results[i].getVariable();
|
String var = results[i].getVariable();
|
||||||
MIValue val = results[i].getMIValue();
|
MIValue val = results[i].getMIValue();
|
||||||
MIBreakPoint bpt = null;
|
MIBreakpoint bpt = null;
|
||||||
if (var.equals("wpt")) {
|
if (var.equals("wpt")) {
|
||||||
if (val instanceof MITuple) {
|
if (val instanceof MITuple) {
|
||||||
bpt = new MIBreakPoint((MITuple)val);
|
bpt = new MIBreakpoint((MITuple)val);
|
||||||
bpt.setEnabled(true);
|
bpt.setEnabled(true);
|
||||||
bpt.setWriteWatchpoint(true);
|
bpt.setWriteWatchpoint(true);
|
||||||
}
|
}
|
||||||
} else if (var.equals("bkpt")) {
|
} else if (var.equals("bkpt")) {
|
||||||
if (val instanceof MITuple) {
|
if (val instanceof MITuple) {
|
||||||
bpt = new MIBreakPoint((MITuple)val);
|
bpt = new MIBreakpoint((MITuple)val);
|
||||||
bpt.setEnabled(true);
|
bpt.setEnabled(true);
|
||||||
}
|
}
|
||||||
} else if (var.equals("hw-awpt")) {
|
} else if (var.equals("hw-awpt")) {
|
||||||
if (val instanceof MITuple) {
|
if (val instanceof MITuple) {
|
||||||
bpt = new MIBreakPoint((MITuple)val);
|
bpt = new MIBreakpoint((MITuple)val);
|
||||||
bpt.setAccessWatchpoint(true);
|
bpt.setAccessWatchpoint(true);
|
||||||
bpt.setEnabled(true);
|
bpt.setEnabled(true);
|
||||||
}
|
}
|
||||||
} else if (var.equals("hw-rwpt")) {
|
} else if (var.equals("hw-rwpt")) {
|
||||||
if (val instanceof MITuple) {
|
if (val instanceof MITuple) {
|
||||||
bpt = new MIBreakPoint((MITuple)val);
|
bpt = new MIBreakpoint((MITuple)val);
|
||||||
bpt.setReadWatchpoint(true);
|
bpt.setReadWatchpoint(true);
|
||||||
bpt.setEnabled(true);
|
bpt.setEnabled(true);
|
||||||
}
|
}
|
||||||
|
@ -64,14 +64,14 @@ public class MIBreakInsertInfo extends MIInfo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
breakpoints = (MIBreakPoint[])aList.toArray(new MIBreakPoint[aList.size()]);
|
breakpoints = (MIBreakpoint[])aList.toArray(new MIBreakpoint[aList.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MIBreakInsertInfo(MIOutput record) {
|
public MIBreakInsertInfo(MIOutput record) {
|
||||||
super(record);
|
super(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MIBreakPoint[] getBreakPoints() {
|
public MIBreakpoint[] getMIBreakpoints() {
|
||||||
if (breakpoints == null) {
|
if (breakpoints == null) {
|
||||||
parse();
|
parse();
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,13 +18,13 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public class MIBreakListInfo extends MIInfo {
|
public class MIBreakListInfo extends MIInfo {
|
||||||
|
|
||||||
MIBreakPoint[] breakpoints;
|
MIBreakpoint[] breakpoints;
|
||||||
|
|
||||||
public MIBreakListInfo(MIOutput rr) {
|
public MIBreakListInfo(MIOutput rr) {
|
||||||
super(rr);
|
super(rr);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MIBreakPoint[] getBreakPoints() {
|
public MIBreakpoint[] getMIBreakpoints() {
|
||||||
if (breakpoints == null) {
|
if (breakpoints == null) {
|
||||||
parse();
|
parse();
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ public class MIBreakListInfo extends MIInfo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
breakpoints = (MIBreakPoint[])aList.toArray(new MIBreakPoint[aList.size()]);
|
breakpoints = (MIBreakpoint[])aList.toArray(new MIBreakpoint[aList.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void parseTable(MIValue val, List aList) {
|
void parseTable(MIValue val, List aList) {
|
||||||
|
@ -69,7 +69,7 @@ public class MIBreakListInfo extends MIInfo {
|
||||||
if (b.equals("bkpt")) {
|
if (b.equals("bkpt")) {
|
||||||
MIValue value = bkpts[i].getMIValue();
|
MIValue value = bkpts[i].getMIValue();
|
||||||
if (value instanceof MITuple) {
|
if (value instanceof MITuple) {
|
||||||
aList.add(new MIBreakPoint((MITuple)value));
|
aList.add(new MIBreakpoint((MITuple)value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ package org.eclipse.cdt.debug.mi.core.output;
|
||||||
* </li>
|
* </li>
|
||||||
*</ul>
|
*</ul>
|
||||||
*/
|
*/
|
||||||
public class MIBreakPoint {
|
public class MIBreakpoint {
|
||||||
|
|
||||||
int number;
|
int number;
|
||||||
String type = "";
|
String type = "";
|
||||||
|
@ -63,7 +63,7 @@ public class MIBreakPoint {
|
||||||
boolean isRWpt;
|
boolean isRWpt;
|
||||||
boolean isWWpt;
|
boolean isWWpt;
|
||||||
|
|
||||||
public MIBreakPoint(MITuple tuple) {
|
public MIBreakpoint(MITuple tuple) {
|
||||||
parse(tuple);
|
parse(tuple);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue