use of com.oracle.truffle.espresso.jdwp.impl.FieldBreakpointInfo in project graal by oracle.
the class VMEventListenerImpl method writeSharedFieldInformation.
private PacketStream writeSharedFieldInformation(FieldBreakpointEvent event, Object currentThread, CallFrame callFrame, byte eventType) {
PacketStream stream = new PacketStream().commandPacket().commandSet(64).command(100);
FieldBreakpointInfo info = event.getInfo();
stream.writeByte(info.getSuspendPolicy());
// # events in reply
stream.writeInt(1);
stream.writeByte(eventType);
stream.writeInt(info.getRequestId());
long threadId = ids.getIdAsLong(currentThread);
stream.writeLong(threadId);
// location
stream.writeByte(callFrame.getTypeTag());
stream.writeLong(callFrame.getClassId());
stream.writeLong(callFrame.getMethodId());
stream.writeLong(callFrame.getCodeIndex());
// tagged refType
KlassRef klass = info.getKlass();
stream.writeByte(TypeTag.getKind(klass));
stream.writeLong(context.getIds().getIdAsLong(klass));
// fieldID
stream.writeLong(context.getIds().getIdAsLong(info.getField()));
// tagged object ID for field being accessed
stream.writeByte(TagConstants.OBJECT);
if (Modifier.isStatic(info.getField().getModifiers())) {
stream.writeLong(0);
} else {
stream.writeLong(context.getIds().getIdAsLong(event.getReceiver()));
}
return stream;
}
use of com.oracle.truffle.espresso.jdwp.impl.FieldBreakpointInfo in project graal by oracle.
the class VMEventListenerImpl method onFieldModification.
@Override
@TruffleBoundary
public boolean onFieldModification(FieldRef field, Object receiver, Object value) {
boolean active = false;
for (FieldBreakpoint info : field.getFieldBreakpointInfos()) {
if (info.isModificationBreakpoint()) {
// OK, tell the Debug API to suspend the thread now
debuggerController.prepareFieldBreakpoint(new FieldBreakpointEvent((FieldBreakpointInfo) info, receiver, value));
debuggerController.suspend(context.asGuestThread(Thread.currentThread()));
active = true;
}
}
return active;
}
use of com.oracle.truffle.espresso.jdwp.impl.FieldBreakpointInfo in project graal by oracle.
the class VMEventListenerImpl method onFieldAccess.
@Override
@TruffleBoundary
public boolean onFieldAccess(FieldRef field, Object receiver) {
boolean active = false;
for (FieldBreakpoint info : field.getFieldBreakpointInfos()) {
if (info.isAccessBreakpoint()) {
// OK, tell the Debug API to suspend the thread now
debuggerController.prepareFieldBreakpoint(new FieldBreakpointEvent((FieldBreakpointInfo) info, receiver));
debuggerController.suspend(context.asGuestThread(Thread.currentThread()));
active = true;
}
}
return active;
}
Aggregations