Search in sources :

Example 1 with DsfServiceEventHandler

use of org.eclipse.cdt.dsf.service.DsfServiceEventHandler in project usbdm-eclipse-plugins by podonoghue.

the class GdbDsfSessionListener method handleDsfEvent.

/**
 */
@DsfServiceEventHandler
public void handleDsfEvent(IExitedDMEvent event) {
    String sessionId = event.getDMContext().getSessionId();
    // System.err.println(String.format("handleDsfEvent(IExitedDMEvent, s=%s, r=%s)", sessionId, event.toString()));
    UsbdmDevicePeripheralsModel deviceModel = dsfSessions.get(sessionId);
    if (deviceModel != null) {
        for (GdbSessionListener sessionListener : gdbSessionListeners) {
            sessionListener.sessionTerminated(deviceModel);
        }
    }
}
Also used : UsbdmDevicePeripheralsModel(net.sourceforge.usbdm.peripherals.model.UsbdmDevicePeripheralsModel) DsfServiceEventHandler(org.eclipse.cdt.dsf.service.DsfServiceEventHandler)

Example 2 with DsfServiceEventHandler

use of org.eclipse.cdt.dsf.service.DsfServiceEventHandler in project usbdm-eclipse-plugins by podonoghue.

the class GdbDsfSessionListener method handleDsfEvent.

/**
 */
@DsfServiceEventHandler
public void handleDsfEvent(ISuspendedDMEvent event) {
    String sessionId = event.getDMContext().getSessionId();
    UsbdmDevicePeripheralsModel devicePeripheralsModel = dsfSessions.get(sessionId);
    if (devicePeripheralsModel != null) {
        DeviceModel deviceModel = devicePeripheralsModel.getModel();
        if (deviceModel != null) {
            // Set current register values as the 'reference' for changed values
            deviceModel.setChangeReference();
            // Set all registers as stale
            deviceModel.setNeedsUpdate(true);
        }
    }
    for (GdbSessionListener sessionListener : gdbSessionListeners) {
        sessionListener.sessionSuspended(devicePeripheralsModel, GdbSessionListener.EventType.getEventFromDsfEvent(event.getReason()));
    }
}
Also used : DeviceModel(net.sourceforge.usbdm.peripherals.model.DeviceModel) UsbdmDevicePeripheralsModel(net.sourceforge.usbdm.peripherals.model.UsbdmDevicePeripheralsModel) DsfServiceEventHandler(org.eclipse.cdt.dsf.service.DsfServiceEventHandler)

Aggregations

UsbdmDevicePeripheralsModel (net.sourceforge.usbdm.peripherals.model.UsbdmDevicePeripheralsModel)2 DsfServiceEventHandler (org.eclipse.cdt.dsf.service.DsfServiceEventHandler)2 DeviceModel (net.sourceforge.usbdm.peripherals.model.DeviceModel)1