Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Khodjaiants2004-10-11 20:24:15 +0000
committerMikhail Khodjaiants2004-10-11 20:24:15 +0000
commitacf19e50fa65590efee798b6f494aa295ba8a029 (patch)
tree47aa9d628b4d9a864fe4009cb3c2ce139ba9397a
parent06b4f414c0394080a502e8ce63b72b4807db6a11 (diff)
downloadorg.eclipse.cdt-acf19e50fa65590efee798b6f494aa295ba8a029.tar.gz
org.eclipse.cdt-acf19e50fa65590efee798b6f494aa295ba8a029.tar.xz
org.eclipse.cdt-acf19e50fa65590efee798b6f494aa295ba8a029.zip
Added the launch configuration preference for the register bookkeeping.
-rw-r--r--debug/org.eclipse.cdt.debug.core/ChangeLog8
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDTLaunchConfigurationConstants.java5
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CExpression.java7
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegister.java15
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegisterGroup.java4
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java2
-rw-r--r--launch/org.eclipse.cdt.launch/ChangeLog5
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPluginResources.properties4
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java52
9 files changed, 77 insertions, 25 deletions
diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog
index 8730d03ef82..7b9eac86577 100644
--- a/debug/org.eclipse.cdt.debug.core/ChangeLog
+++ b/debug/org.eclipse.cdt.debug.core/ChangeLog
@@ -1,4 +1,12 @@
2004-10-08 Mikhail Khodjaiants
+ Added the launch configuration preference for the register bookkeeping.
+ * ICDTLaunchConfigurationConstants.java
+ * CExpression.java
+ * CRegister.java
+ * CRegisterGroup.java
+ * CVariable.java
+
+2004-10-08 Mikhail Khodjaiants
Added the bookkeeping of registers and register groups.
* ICVariable.java
* IEnableDisableTarget.java: new
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDTLaunchConfigurationConstants.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDTLaunchConfigurationConstants.java
index a1e1f108136..1b8301e6e47 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDTLaunchConfigurationConstants.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDTLaunchConfigurationConstants.java
@@ -103,6 +103,11 @@ public interface ICDTLaunchConfigurationConstants {
public static final String ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING = CDT_LAUNCH_ID + ".ENABLE_VARIABLE_BOOKKEEPING"; //$NON-NLS-1$
/**
+ * Launch configuration attribute key. The value is a boolean specifying whether to enable register bookkeeping.
+ */
+ public static final String ATTR_DEBUGGER_ENABLE_REGISTER_BOOKKEEPING = CDT_LAUNCH_ID + ".ENABLE_REGISTER_BOOKKEEPING"; //$NON-NLS-1$
+
+ /**
* Launch configuration attribute key. The value is a global variables' memento.
*/
public static final String ATTR_DEBUGGER_GLOBAL_VARIABLES = CDT_LAUNCH_ID + ".GLOBAL_VARIABLES"; //$NON-NLS-1$
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CExpression.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CExpression.java
index 40c9c58bb8d..a3095faccbc 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CExpression.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CExpression.java
@@ -100,4 +100,11 @@ public class CExpression extends CVariable implements IExpression {
public boolean canEnableDisable() {
return false;
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.debug.internal.core.model.CVariable#isBookkeepingEnabled()
+ */
+ protected boolean isBookkeepingEnabled() {
+ return false;
+ }
} \ No newline at end of file
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegister.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegister.java
index 1ab0c5b89e6..b1ad016d65c 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegister.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegister.java
@@ -11,10 +11,12 @@
package org.eclipse.cdt.debug.internal.core.model;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
+import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.core.ICDebugConstants;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegister;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterObject;
import org.eclipse.cdt.debug.core.model.CVariableFormat;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IRegister;
import org.eclipse.debug.core.model.IRegisterGroup;
@@ -46,4 +48,17 @@ public class CRegister extends CGlobalVariable implements IRegister {
public IRegisterGroup getRegisterGroup() throws DebugException {
return (IRegisterGroup)getParent();
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.debug.internal.core.model.CVariable#isBookkeepingEnabled()
+ */
+ protected boolean isBookkeepingEnabled() {
+ boolean result = false;
+ try {
+ result = getLaunch().getLaunchConfiguration().getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_REGISTER_BOOKKEEPING, false );
+ }
+ catch( CoreException e ) {
+ }
+ return result;
+ }
} \ No newline at end of file
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegisterGroup.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegisterGroup.java
index 4a650687711..fecbaf3aef7 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegisterGroup.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegisterGroup.java
@@ -61,7 +61,9 @@ public class CRegisterGroup extends CDebugElement implements IRegisterGroup, IEn
catch( DebugException e ) {
fRegisters[i] = new CRegister( this, fRegisterObjects[i], e.getMessage() );
}
- ((CRegister)fRegisters[i]).setEnabled( isEnabled() );
+ if ( ((CRegister)fRegisters[i]).isEnabled() ) {
+ ((CRegister)fRegisters[i]).setEnabled( isEnabled() );
+ }
}
}
return fRegisters;
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java
index bba9778626e..aa501f9438b 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java
@@ -707,7 +707,7 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
fShadow = shadow;
}
- private boolean isBookkeepingEnabled() {
+ protected boolean isBookkeepingEnabled() {
boolean result = false;
try {
result = getLaunch().getLaunchConfiguration().getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING, false );
diff --git a/launch/org.eclipse.cdt.launch/ChangeLog b/launch/org.eclipse.cdt.launch/ChangeLog
index 5c4546acf4f..fb90665ccf8 100644
--- a/launch/org.eclipse.cdt.launch/ChangeLog
+++ b/launch/org.eclipse.cdt.launch/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-08 Mikhail Khodjaiants
+ Added the launch configuration preference for the register bookkeeping.
+ * LaunchUIPluginResources.properties
+ * CDebuggerTab.java
+
2004-08-23 Mikhail Khodjaiants
Changes in the "Debugger" tab of the launch configuration dialog.
Replaced the "Run in debugger/Attach to running process" radio button by
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPluginResources.properties b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPluginResources.properties
index d8505d7ccee..fad346d7564 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPluginResources.properties
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPluginResources.properties
@@ -93,10 +93,12 @@ CMainTab.Choose_program_to_run_from_NAME=Choose a program to run from {0}:
CDebuggerTab.Attach_to_running_process=Attach to running process
CDebuggerTab.Advanced_Options_Dialog_Title=Advanced Options
CDebuggerTab.Stop_at_main_on_startup=Stop at main() on startup
-CDebuggerTab.Automatically_track_values_of_variables=Automatically track the values of variables.
+CDebuggerTab.Automatically_track_values_of=Automatically track the values of
CDebuggerTab.Debugger_Options=Debugger Options
CDebuggerTab.Mode_not_supported=Mode ''{0}'' is not supported by selected debugger
CDebuggerTab.Advanced=Advanced...
+CDebuggerTab.Variables=Variables
+CDebuggerTab.Registers=Registers
CDebuggerTab.No_debugger_available=No debugger available
CDebuggerTab.CPU_is_not_supported=The CPU is not supported by selected debugger.
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java
index b4163c2885e..2e05eedd040 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java
@@ -50,14 +50,13 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
private Button fVarBookKeeping;
- private Map fAttributes;
+ private Button fRegBookKeeping;
- /**
- * Constructor for AdvancedDebuggerOptionsDialog.
+ /**
+ * Constructor for AdvancedDebuggerOptionsDialog.
*/
- public AdvancedDebuggerOptionsDialog( Shell parentShell, Map attributes ) {
+ protected AdvancedDebuggerOptionsDialog( Shell parentShell ) {
super( parentShell );
- fAttributes = attributes;
}
/* (non-Javadoc)
@@ -65,31 +64,38 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
*/
protected Control createDialogArea( Composite parent ) {
Composite composite = (Composite)super.createDialogArea( parent );
- fVarBookKeeping = new Button( composite, SWT.CHECK );
- fVarBookKeeping.setText( LaunchUIPlugin.getResourceString( "CDebuggerTab.Automatically_track_values_of_variables" ) ); //$NON-NLS-1$
+ Group group = new Group( composite, SWT.NONE );
+ group.setText( LaunchUIPlugin.getResourceString( "CDebuggerTab.Automatically_track_values_of" ) ); //$NON-NLS-1$
+ GridLayout layout = new GridLayout();
+ group.setLayout( layout );
+ group.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+ fVarBookKeeping = new Button( group, SWT.CHECK );
+ fVarBookKeeping.setText( LaunchUIPlugin.getResourceString( "CDebuggerTab.Variables" ) ); //$NON-NLS-1$
+ fRegBookKeeping = new Button( group, SWT.CHECK );
+ fRegBookKeeping.setText( LaunchUIPlugin.getResourceString( "CDebuggerTab.Registers" ) ); //$NON-NLS-1$
initialize();
return composite;
}
- private Map getAttributes() {
- return fAttributes;
- }
-
protected void okPressed() {
saveValues();
super.okPressed();
}
private void initialize() {
- Map attr = getAttributes();
+ Map attr = getAdvancedAttributes();
Object varBookkeeping = attr.get( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING );
fVarBookKeeping.setSelection( ( varBookkeeping instanceof Boolean ) ? !((Boolean)varBookkeeping).booleanValue() : true );
+ Object regBookkeeping = attr.get( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_REGISTER_BOOKKEEPING );
+ fRegBookKeeping.setSelection( ( regBookkeeping instanceof Boolean ) ? !((Boolean)regBookkeeping).booleanValue() : true );
}
private void saveValues() {
- Map attr = getAttributes();
+ Map attr = getAdvancedAttributes();
Boolean varBookkeeping = ( fVarBookKeeping.getSelection() ) ? Boolean.FALSE : Boolean.TRUE;
attr.put( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING, varBookkeeping );
+ Boolean regBookkeeping = ( fRegBookKeeping.getSelection() ) ? Boolean.FALSE : Boolean.TRUE;
+ attr.put( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_REGISTER_BOOKKEEPING, regBookkeeping );
updateLaunchConfigurationDialog();
}
@@ -100,14 +106,6 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
super.configureShell( newShell );
newShell.setText( LaunchUIPlugin.getResourceString( "CDebuggerTab.Advanced_Options_Dialog_Title" ) ); //$NON-NLS-1$
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.window.Window#close()
- */
- public boolean close() {
- fAttributes.clear();
- return super.close();
- }
}
protected Combo fDCombo;
@@ -191,6 +189,7 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
super.setDefaults( config );
config.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_DEFAULT );
config.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING, false );
+ config.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_REGISTER_BOOKKEEPING, false );
config.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN );
}
@@ -349,7 +348,7 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
fAdvancedButton.addSelectionListener( new SelectionAdapter() {
public void widgetSelected( SelectionEvent e ) {
- Dialog dialog = new AdvancedDebuggerOptionsDialog( getShell(), getAdvancedAttributes() );
+ Dialog dialog = new AdvancedDebuggerOptionsDialog( getShell() );
dialog.open();
}
} );
@@ -381,6 +380,12 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
}
catch( CoreException e ) {
}
+ try {
+ Boolean regBookkeeping = ( config.getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_REGISTER_BOOKKEEPING, false ) ) ? Boolean.TRUE : Boolean.FALSE;
+ attr.put( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_REGISTER_BOOKKEEPING, regBookkeeping );
+ }
+ catch( CoreException e ) {
+ }
}
private void applyAdvancedAttributes( ILaunchConfigurationWorkingCopy config ) {
@@ -388,6 +393,9 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
Object varBookkeeping = attr.get( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING );
if ( varBookkeeping instanceof Boolean )
config.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING, ((Boolean)varBookkeeping).booleanValue() );
+ Object regBookkeeping = attr.get( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_REGISTER_BOOKKEEPING );
+ if ( regBookkeeping instanceof Boolean )
+ config.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_REGISTER_BOOKKEEPING, ((Boolean)regBookkeeping).booleanValue() );
}
protected Shell getShell() {

Back to the top