mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-05 16:15:25 +02:00
Bug 497349 - Reverse debug is always enabled when attaching to a process
Change-Id: I3761e57fb625cab31e013676d3eda7f214496918
This commit is contained in:
parent
db2d46c7fc
commit
efa5f6a75f
1 changed files with 30 additions and 24 deletions
|
@ -56,30 +56,36 @@ public class GDBProcesses_7_10 extends GDBProcesses_7_4 {
|
||||||
ILaunch launch = procCtx.getAdapter(ILaunch.class);
|
ILaunch launch = procCtx.getAdapter(ILaunch.class);
|
||||||
if (launch != null) {
|
if (launch != null) {
|
||||||
try {
|
try {
|
||||||
ICommandControlDMContext controlContext = DMContexts.getAncestorOfType(procCtx, ICommandControlDMContext.class);
|
boolean reverseEnabled =
|
||||||
String reverseMode =
|
launch.getLaunchConfiguration().getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REVERSE,
|
||||||
launch.getLaunchConfiguration().getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REVERSE_MODE,
|
IGDBLaunchConfigurationConstants.DEBUGGER_REVERSE_DEFAULT);
|
||||||
IGDBLaunchConfigurationConstants.DEBUGGER_REVERSE_MODE_DEFAULT);
|
if (reverseEnabled) {
|
||||||
if (reverseMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_REVERSE_MODE_SOFTWARE)) {
|
ICommandControlDMContext controlContext = DMContexts.getAncestorOfType(procCtx, ICommandControlDMContext.class);
|
||||||
reverseService.enableReverseMode(controlContext, ReverseDebugMethod.SOFTWARE, rm);
|
String reverseMode =
|
||||||
}
|
launch.getLaunchConfiguration().getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REVERSE_MODE,
|
||||||
else if (reverseMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_REVERSE_MODE_HARDWARE)) {
|
IGDBLaunchConfigurationConstants.DEBUGGER_REVERSE_MODE_DEFAULT);
|
||||||
String defaultValue = Platform.getPreferencesService().getString(GdbPlugin.PLUGIN_ID,
|
if (reverseMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_REVERSE_MODE_SOFTWARE)) {
|
||||||
IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_HARDWARE,
|
reverseService.enableReverseMode(controlContext, ReverseDebugMethod.SOFTWARE, rm);
|
||||||
IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_GDB_TRACE, null);
|
} else if (reverseMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_REVERSE_MODE_HARDWARE)) {
|
||||||
|
String defaultValue = Platform.getPreferencesService().getString(GdbPlugin.PLUGIN_ID,
|
||||||
ReverseDebugMethod traceMethod = ReverseDebugMethod.GDB_TRACE;
|
IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_HARDWARE,
|
||||||
if (defaultValue.equals(IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_BRANCH_TRACE)) {
|
IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_GDB_TRACE, null);
|
||||||
traceMethod = ReverseDebugMethod.BRANCH_TRACE;
|
|
||||||
} else if (defaultValue.equals(IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_PROCESSOR_TRACE)) {
|
ReverseDebugMethod traceMethod = ReverseDebugMethod.GDB_TRACE;
|
||||||
traceMethod = ReverseDebugMethod.PROCESSOR_TRACE;
|
if (defaultValue.equals(IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_BRANCH_TRACE)) {
|
||||||
}
|
traceMethod = ReverseDebugMethod.BRANCH_TRACE;
|
||||||
|
} else if (defaultValue.equals(IGdbDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_PROCESSOR_TRACE)) {
|
||||||
reverseService.enableReverseMode(controlContext, traceMethod, rm);
|
traceMethod = ReverseDebugMethod.PROCESSOR_TRACE;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Unexpected Reverse debugging mode " + reverseMode, null)); //$NON-NLS-1$
|
reverseService.enableReverseMode(controlContext, traceMethod, rm);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Unexpected Reverse debugging mode " + reverseMode, null)); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
rm.done();
|
||||||
|
}
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
// Ignore, just don't set reverse method
|
// Ignore, just don't set reverse method
|
||||||
rm.done();
|
rm.done();
|
||||||
|
|
Loading…
Add table
Reference in a new issue