1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-01 04:33:36 +02:00

Cosmetics

Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
This commit is contained in:
Marc Khouzam 2016-02-27 07:46:50 -05:00
parent 69562ae63e
commit e6e50c16fb

View file

@ -110,44 +110,41 @@ public class GdbReverseToggleCommand extends AbstractDebugCommand implements ICh
if (runControl != null) { if (runControl != null) {
ReverseTraceMethod traceMethod = fTraceMethod; ReverseTraceMethod traceMethod = fTraceMethod;
if (fTraceMethod == ReverseTraceMethod.HARDWARE_TRACE) { if (fTraceMethod == ReverseTraceMethod.HARDWARE_TRACE) {
if (Platform.getPreferencesService().getString(GdbPlugin.PLUGIN_ID, String defaultValue = Platform.getPreferencesService().getString(GdbPlugin.PLUGIN_ID,
IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_HARDWARE, IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_HARDWARE,
IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_GDB_TRACE, IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_GDB_TRACE, null);
null).equals(IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_BRANCH_TRACE)) {
traceMethod = ReverseTraceMethod.BRANCH_TRACE; // Branch Trace if (defaultValue.equals(IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_BRANCH_TRACE)) {
} else if (Platform.getPreferencesService().getString(GdbPlugin.PLUGIN_ID, traceMethod = ReverseTraceMethod.BRANCH_TRACE; // Branch Trace
IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_HARDWARE, } else if (defaultValue.equals(IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_PROCESSOR_TRACE)) {
IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_GDB_TRACE, traceMethod = ReverseTraceMethod.PROCESSOR_TRACE; // Processor Trace
null).equals(IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_PROCESSOR_TRACE)) { } else {
traceMethod = ReverseTraceMethod.PROCESSOR_TRACE; // Processor Trace traceMethod = ReverseTraceMethod.GDB_TRACE; // GDB Selected Option
} else { }
traceMethod = ReverseTraceMethod.GDB_TRACE; // GDB Selected Option
}
} }
runControl.enableReverseMode(controlDmc, traceMethod, new DataRequestMonitor<Boolean>(fExecutor, rm) { runControl.enableReverseMode(controlDmc, traceMethod, new DataRequestMonitor<Boolean>(fExecutor, rm) {
@Override @Override
public void handleError() { public void handleError() {
// Call the parent function // Call the parent function
// Since otherwise the status is not updated // Since otherwise the status is not updated
super.handleError(); super.handleError();
// Here we avoid setting any status other than OK, since we want to // Here we avoid setting any status other than OK, since we want to
// avoid the default dialog box from eclipse and we propagate the error // avoid the default dialog box from eclipse and we propagate the error
// with the plugin specific code of 1, here the ReverseToggleCommandHandler // with the plugin specific code of 1, here the ReverseToggleCommandHandler
// interprets it as, the selected trace method is not available // interprets it as, the selected trace method is not available
request.setStatus(new Status(IStatus.OK, GdbPlugin.PLUGIN_ID, 1, Messages.GdbReverseDebugging_HardwareTracingNotAvailable, null)); request.setStatus(new Status(IStatus.OK, GdbPlugin.PLUGIN_ID, 1, Messages.GdbReverseDebugging_HardwareTracingNotAvailable, null));
} }
}); });
} else { } else {
final IReverseRunControl runControl_old = fTracker.getService(IReverseRunControl.class); final IReverseRunControl runControl_old = fTracker.getService(IReverseRunControl.class);
if (runControl_old != null) { if (runControl_old != null) {
if(fTraceMethod != ReverseTraceMethod.STOP_TRACE && fTraceMethod != ReverseTraceMethod.FULL_TRACE) { if (fTraceMethod != ReverseTraceMethod.STOP_TRACE && fTraceMethod != ReverseTraceMethod.FULL_TRACE) {
runControl_old.enableReverseMode(controlDmc, false, rm); // Swtich Off tracing runControl_old.enableReverseMode(controlDmc, false, rm); // Switch Off tracing
request.setStatus(new Status(IStatus.OK, GdbPlugin.PLUGIN_ID, 1, Messages.GdbReverseDebugging_HardwareTracingNotAvailable, null)); request.setStatus(new Status(IStatus.OK, GdbPlugin.PLUGIN_ID, 1, Messages.GdbReverseDebugging_HardwareTracingNotAvailable, null));
return; return;
} }
runControl_old.isReverseModeEnabled(controlDmc, runControl_old.isReverseModeEnabled(controlDmc, new DataRequestMonitor<Boolean>(fExecutor, rm) {
new DataRequestMonitor<Boolean>(fExecutor, rm) {
@Override @Override
public void handleSuccess() { public void handleSuccess() {
runControl_old.enableReverseMode(controlDmc, !getData(), rm); runControl_old.enableReverseMode(controlDmc, !getData(), rm);