From 185cb818c138f17e1aebe5a35f8f90e63477709f Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Mon, 16 Sep 2002 21:32:17 +0000 Subject: [PATCH] Implementation of Registers view. --- .../internal/core/model/CDebugTarget.java | 51 ++++++ .../debug/internal/core/model/CRegister.java | 39 +++++ .../internal/core/model/CRegisterGroup.java | 156 ++++++++++++++++++ .../internal/core/model/CStackFrame.java | 4 +- .../icons/full/clcl16/change_reg_value_co.gif | Bin 0 -> 171 bytes .../icons/full/clcl16/tnames_co.gif | Bin 0 -> 181 bytes .../icons/full/cview16/registers_view.gif | Bin 336 -> 119 bytes .../icons/full/dlcl16/change_reg_value_co.gif | Bin 0 -> 97 bytes .../icons/full/dlcl16/tnames_co.gif | Bin 0 -> 101 bytes .../icons/full/elcl16/change_reg_value_co.gif | Bin 0 -> 165 bytes .../icons/full/elcl16/tnames_co.gif | Bin 0 -> 145 bytes .../icons/full/eview16/registers_view.gif | Bin 336 -> 118 bytes .../icons/full/obj16/register_obj.gif | Bin 0 -> 118 bytes .../icons/full/obj16/registergroup_obj.gif | Bin 0 -> 255 bytes .../plugin.properties | 3 +- debug/org.eclipse.cdt.debug.ui/plugin.xml | 7 + .../ui/CDTDebugModelPresentation.java | 26 +++ .../cdt/debug/internal/ui/CDebugImages.java | 12 +- .../internal/ui/ICDebugHelpContextIds.java | 5 + .../ui/actions/ChangeRegisterValueAction.java | 43 +++++ .../ui/actions/ShowRegisterTypesAction.java | 91 ++++++++++ .../RegistersViewPreferencePage.java | 100 +++++++++++ .../internal/ui/views/memory/MemoryView.java | 4 +- .../ui/views/registers/RegistersView.java | 25 +++ .../RegistersViewContentProvider.java | 123 +++++++++++++- .../eclipse/cdt/debug/ui/CDebugUIPlugin.java | 2 + .../cdt/debug/ui/ICDebugUIConstants.java | 11 ++ 27 files changed, 692 insertions(+), 10 deletions(-) create mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegister.java create mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegisterGroup.java create mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/change_reg_value_co.gif create mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/tnames_co.gif create mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/change_reg_value_co.gif create mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/tnames_co.gif create mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/change_reg_value_co.gif create mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/tnames_co.gif create mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/register_obj.gif create mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/registergroup_obj.gif create mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ChangeRegisterValueAction.java create mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowRegisterTypesAction.java create mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/RegistersViewPreferencePage.java diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java index 31f9ca9ddb9..96d81da863a 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java @@ -29,6 +29,7 @@ import org.eclipse.cdt.debug.core.cdi.ICDICondition; import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration; import org.eclipse.cdt.debug.core.cdi.ICDIEndSteppingRange; import org.eclipse.cdt.debug.core.cdi.ICDILocation; +import org.eclipse.cdt.debug.core.cdi.ICDIRegisterObject; import org.eclipse.cdt.debug.core.cdi.ICDISessionObject; import org.eclipse.cdt.debug.core.cdi.ICDISignal; import org.eclipse.cdt.debug.core.cdi.ICDIWatchpointScope; @@ -64,6 +65,7 @@ import org.eclipse.debug.core.model.IBreakpoint; import org.eclipse.debug.core.model.IDebugTarget; import org.eclipse.debug.core.model.IMemoryBlock; import org.eclipse.debug.core.model.IProcess; +import org.eclipse.debug.core.model.IRegisterGroup; import org.eclipse.debug.core.model.IThread; /** @@ -173,6 +175,11 @@ public class CDebugTarget extends CDebugElement */ private HashMap fBreakpoints; + /** + * Collection of register groups added to this target. Values are of type CRegisterGroup. + */ + private List fRegisterGroups; + /** * Constructor for CDebugTarget. * @param target @@ -211,6 +218,7 @@ public class CDebugTarget extends CDebugElement { initializeState(); initializeBreakpoints(); + initializeRegisters(); getLaunch().addDebugTarget( this ); fireCreationEvent(); } @@ -257,6 +265,12 @@ public class CDebugTarget extends CDebugElement } } + protected void initializeRegisters() + { + fRegisterGroups = new ArrayList( 20 ); + createMainRegisterGroup(); + } + /* (non-Javadoc) * @see org.eclipse.debug.core.model.IDebugTarget#getProcess() */ @@ -974,6 +988,7 @@ public class CDebugTarget extends CDebugElement protected void cleanup() { removeAllThreads(); + removeAllRegisterGroups(); getCDISession().getEventManager().removeEventListener( this ); DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener( this ); DebugPlugin.getDefault().getLaunchManager().removeLaunchListener( this ); @@ -1596,4 +1611,40 @@ public class CDebugTarget extends CDebugElement { return isAvailable() && isSuspended(); } + + protected IRegisterGroup[] getRegisterGroups( CStackFrame stackFrame ) throws DebugException + { + Iterator it = fRegisterGroups.iterator(); + while( it.hasNext() ) + { + ((CRegisterGroup)it.next()).refresh( stackFrame ); + } + return (IRegisterGroup[])fRegisterGroups.toArray( new IRegisterGroup[fRegisterGroups.size()] ); + } + + protected void createMainRegisterGroup() + { + ICDIRegisterObject[] regObjects = null; + try + { + regObjects = getCDITarget().getRegisterObjects(); + } + catch( CDIException e ) + { + CDebugCorePlugin.log( e ); + } + if ( regObjects != null ) + { + fRegisterGroups.add( new CRegisterGroup( this, "Main", regObjects ) ); + } + } + + protected void removeAllRegisterGroups() + { + Iterator it = fRegisterGroups.iterator(); + while( it.hasNext() ) + { + ((CRegisterGroup)it.next()).dispose(); + } + } } 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 new file mode 100644 index 00000000000..6ecbf74406c --- /dev/null +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegister.java @@ -0,0 +1,39 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ +package org.eclipse.cdt.debug.internal.core.model; + +import org.eclipse.cdt.debug.core.cdi.model.ICDIRegister; +import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; +import org.eclipse.debug.core.DebugException; +import org.eclipse.debug.core.model.IRegister; +import org.eclipse.debug.core.model.IRegisterGroup; + +/** + * + * Enter type comment. + * + * @since Sep 16, 2002 + */ +public class CRegister extends CModificationVariable implements IRegister +{ + /** + * Constructor for CRegister. + * @param parent + * @param cdiVariable + */ + public CRegister( CRegisterGroup parent, ICDIRegister cdiRegister ) + { + super( parent, cdiRegister ); + } + + /* (non-Javadoc) + * @see org.eclipse.debug.core.model.IRegister#getRegisterGroup() + */ + public IRegisterGroup getRegisterGroup() throws DebugException + { + return (IRegisterGroup)getParent(); + } +} 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 new file mode 100644 index 00000000000..6b184cadd50 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegisterGroup.java @@ -0,0 +1,156 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ +package org.eclipse.cdt.debug.internal.core.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.cdt.debug.core.cdi.CDIException; +import org.eclipse.cdt.debug.core.cdi.ICDIRegisterObject; +import org.eclipse.cdt.debug.core.cdi.model.ICDIRegister; +import org.eclipse.debug.core.DebugException; +import org.eclipse.debug.core.model.IRegister; +import org.eclipse.debug.core.model.IRegisterGroup; + +/** + * + * Enter type comment. + * + * @since Sep 16, 2002 + */ +public class CRegisterGroup extends CDebugElement implements IRegisterGroup +{ + private String fName; + private ICDIRegisterObject[] fRegisterObjects; + private List fRegisters; + private CStackFrame fCurrentStackFrame = null; + + /** + * Whether the registers need refreshing + */ + private boolean fRefresh = true; + + /** + * Constructor for CRegisterGroup. + * @param target + */ + public CRegisterGroup( CDebugTarget target, String name, ICDIRegisterObject[] regObjects ) + { + super( target ); + fName = name; + fRegisterObjects = regObjects; + fRegisters = new ArrayList(); + } + + /* (non-Javadoc) + * @see org.eclipse.debug.core.model.IRegisterGroup#getName() + */ + public String getName() throws DebugException + { + return fName; + } + + /* (non-Javadoc) + * @see org.eclipse.debug.core.model.IRegisterGroup#getRegisters() + */ + public IRegister[] getRegisters() throws DebugException + { + List list = getRegisters0(); + return (IRegister[])list.toArray( new IRegister[list.size()] ); + } + + /* (non-Javadoc) + * @see org.eclipse.debug.core.model.IRegisterGroup#hasRegisters() + */ + public boolean hasRegisters() throws DebugException + { + return getRegisters0().size() > 0; + } + + private List getRegisters0() throws DebugException + { + if ( fRegisters == null ) + { + ICDIRegister[] regs = getCDIRegisters(); + fRegisters = new ArrayList( regs.length ); + for ( int i = 0; i < regs.length; ++i ) + { + fRegisters.add( new CRegister( this, regs[i] ) ); + } + } + else if ( fRefresh ) + { + updateRegisters(); + } + fRefresh = false; + return fRegisters; + } + + protected void dispose() + { + Iterator it = fRegisters.iterator(); + while( it.hasNext() ) + { + ((CRegister)it.next()).dispose(); + } + fRegisters.clear(); + } + + protected void refresh( CStackFrame stackFrame ) + { + setCurrentStackFrame( stackFrame ); + fRefresh = true; + } + + private ICDIRegister[] getCDIRegisters() throws DebugException + { + ICDIRegister[] result = new ICDIRegister[0]; + CStackFrame currentFrame = getCurrentStackFrame(); + if ( currentFrame != null ) + { + /* + try + { + */ + result = getCurrentStackFrame().getCDIStackFrame().getRegisters( fRegisterObjects ); + /* + } + catch( CDIException e ) + { + targetRequestFailed( e.getMessage(), null ); + } + */ + } + return result; + } + + protected void setCurrentStackFrame( CStackFrame stackFrame ) + { + fCurrentStackFrame = stackFrame; + } + + protected CStackFrame getCurrentStackFrame() + { + return fCurrentStackFrame; + } + + private void updateRegisters() throws DebugException + { + ICDIRegister[] cdiRegisters = getCDIRegisters(); + int index = 0; + while( index < fRegisters.size() && index < cdiRegisters.length ) + { + CRegister register = (CRegister)fRegisters.get( index ); + if ( !cdiRegisters[index].equals( register.getCDIVariable() ) ) + { + register.setCDIVariable( cdiRegisters[index] ); + } + index++; + } + } +} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java index ed13c716d7c..32da65805dd 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java @@ -220,7 +220,7 @@ public class CStackFrame extends CDebugElement */ public IRegisterGroup[] getRegisterGroups() throws DebugException { - return new IRegisterGroup[0]; + return ((CDebugTarget)getDebugTarget()).getRegisterGroups( this ); } /* (non-Javadoc) @@ -228,7 +228,7 @@ public class CStackFrame extends CDebugElement */ public boolean hasRegisterGroups() throws DebugException { - return getRegisterGroups().length > 0; + return ((CDebugTarget)getDebugTarget()).getRegisterGroups( this ).length > 0; } /* (non-Javadoc) diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/change_reg_value_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/change_reg_value_co.gif new file mode 100644 index 0000000000000000000000000000000000000000..b6b60770eb20b77228fb878344317f99d2993d8c GIT binary patch literal 171 zcmZ?wbhEHb6krfw*v!CSAHUx|e!hJ@kgTttzu&%oe*FCX^Y`!He}Dh|`}_a@{_y|* z|M~Oh14#xjQ2fcl$iTqMpabH8%wS-N*s#@k^`05awhA2;KdQ^sB*AWxyTnuS)xoJJ zqL1X(N*v>r#j0_B13_2h|kQodtNdYH4wRKNKL_1h@G3HGAF3IVn%_WWE6hbaNet!BM9{S$iMqy#LIXR&@*}>UaK{u}~ zfA{8kd|cR{-`{Uv-hOP`q~qHrpWHFy({TJKYxDv z_U#)tZk#xAV)5d|GiT16F=NKGY15`oo!Z{so|&1Mk&%&_n(E}_1k}ht4WRgwg^__l zgFy#m7|2fyY`G3o3Osbg+&v~uDly`6pO*3EQpqHp`2ikVR*G?|`lPLSIfujT(8l$lw(J_Yj?9Ud7d|Sslm4W*c8LquN~a2r^$S7|r&cWq30UmG#>HR_0Pmt9 AZU6uP literal 0 HcmV?d00001 diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/tnames_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/tnames_co.gif new file mode 100644 index 0000000000000000000000000000000000000000..764201b3783df9638e21fffc6ef74fa7b8b96c5c GIT binary patch literal 101 zcmZ?wbhEHb6krfwn8?7efB*jZ^XLEn|DS<@LGdRGBLf2ygAR}llobH7&8GBs3M@F~ zB=AO3b7r;V`{ynWEs2LjBA;i4aYoI0f3qUS%~Wia(q;Z77gg3Md@O${sK4>qLIwtF E0D<}>KL7v# literal 0 HcmV?d00001 diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/change_reg_value_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/change_reg_value_co.gif new file mode 100644 index 0000000000000000000000000000000000000000..899ad97909e9e3a2fe992c3b5cb845661eefeb8f GIT binary patch literal 165 zcmZ?wbhEHb6krfw*v!Ci|Nj2}|NkF2aA5!b{qyI~Z)j+!udk1fj|U1eU;~OjSr{1@ zI2d$5k{~k}Sb_u=I~2@CIf78!g9Qds`5^Qg?0>+6aGo|f(B*ziL^F@NE`<{G_z1_o;Y{8m0V literal 0 HcmV?d00001 diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/tnames_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/tnames_co.gif new file mode 100644 index 0000000000000000000000000000000000000000..c63f59ece282551d7a3614653212aba130b3b03c GIT binary patch literal 145 zcmV;C0B-+BNk%w1VGsZi0HOc@KR;jp|Np<>?Xl~Q zmVuXL2ZP1yn0x`o2aQS>riORTy0&W7bMZdo>f9Z%r>raY>B$QGVE&M?>&`Oc46FJ6 M?Im8JDhv$P0OIy2`2YX_ literal 336 zcmZ?wbhEHb6krfw_{zZW|NsBg)YO|dZ@zo??$4h;KyG$+c1}*tv17-MA3uKb8DtRU~XJw0tn{S6vroYO<4#7_xH{bKOZ#;P8$A2E~ zYA#NWHV#g%CRbi|w*Cq1-OjwMEYoMqn9ML$VBY+B%(Ho!nU*bIKAVwy&DwRd{WflL Ib7Zgv0IJ`0sQ>@~ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/register_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/register_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..277322cf606c3eaa17dff746a8123ff34dfc6d62 GIT binary patch literal 118 zcmZ?wbhEHb6krfwSi}GX4e|5$*Vo6-pI`qU3_xNG42nNl7#SE?8FWA#kXi<2>xf-< z{^gwTT&dCg;_Uaci~<4-f_+cj*QM@WmG>uU*^YU|*WR+kEZ#5YtM*y2*gTqZ`J+<1 NrWGYttr5Zu)&QDmET#Ye literal 0 HcmV?d00001 diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/registergroup_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/registergroup_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..952c2af4ab141eb1fe90a2c3e0421b9e6843ed8f GIT binary patch literal 255 zcmZ?wbhEHb6krfwIKlt~4fgi)?d{|3*+9oZO9cq&E6PM*Bjv5m{Db5rsf@r|kilX4XqW{d4| zY;n*@*m1w$$D+S0ZomI#`Ph*`K#rlNu7RJMvAVIdrHfmjqkBRlw{UfBedDy2$<-Be WTc>a@T(o$x@UrDARxVRyum%8w5? + + @@ -231,4 +237,5 @@ id="org.eclipse.cdt.debug.internal.ui.editors.DebugTextHover"> + diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java index e7f5dab11e0..960ddabd4ce 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java @@ -35,6 +35,8 @@ import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.model.IBreakpoint; import org.eclipse.debug.core.model.IDebugTarget; import org.eclipse.debug.core.model.IDisconnect; +import org.eclipse.debug.core.model.IRegister; +import org.eclipse.debug.core.model.IRegisterGroup; import org.eclipse.debug.core.model.IStackFrame; import org.eclipse.debug.core.model.ITerminate; import org.eclipse.debug.core.model.IThread; @@ -175,6 +177,14 @@ public class CDTDebugModelPresentation extends LabelProvider { return getBreakpointImage( (ICBreakpoint)element ); } + if ( element instanceof IRegisterGroup ) + { + return getRegisterGroupImage( (IRegisterGroup)element ); + } + if ( element instanceof IRegister ) + { + return getRegisterImage( (IRegister)element ); + } if ( element instanceof IVariable ) { return getVariableImage( (IVariable)element ); @@ -195,6 +205,12 @@ public class CDTDebugModelPresentation extends LabelProvider StringBuffer label = new StringBuffer(); try { + if ( element instanceof IRegisterGroup ) + { + label.append( ((IRegisterGroup)element).getName() ); + return label.toString(); + } + if ( element instanceof IVariable ) { label.append( getVariableText( (IVariable)element ) ); @@ -645,4 +661,14 @@ public class CDTDebugModelPresentation extends LabelProvider } return null; } + + protected Image getRegisterGroupImage( IRegisterGroup element ) throws DebugException + { + return fDebugImageRegistry.get( new CImageDescriptor( CDebugImages.DESC_OBJS_REGISTER_GROUP, 0 ) ); + } + + protected Image getRegisterImage( IRegister element ) throws DebugException + { + return fDebugImageRegistry.get( new CImageDescriptor( CDebugImages.DESC_OBJS_REGISTER, 0 ) ); + } } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java index cb329814eb3..3b2baf1f604 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java @@ -58,6 +58,11 @@ public class CDebugImages public static final String IMG_OBJS_VARIABLE_AGGREGATE = NAME_PREFIX + "var_aggr.gif"; //$NON-NLS-1$ public static final String IMG_OBJS_VARIABLE_POINTER = NAME_PREFIX + "var_pointer.gif"; //$NON-NLS-1$ public static final String IMG_OBJS_VARIABLE_STRING = NAME_PREFIX + "var_string.gif"; //$NON-NLS-1$ + public static final String IMG_OBJS_REGISTER_GROUP = NAME_PREFIX + "registergroup_obj.gif"; //$NON-NLS-1$ + public static final String IMG_OBJS_REGISTER = NAME_PREFIX + "register_obj.gif"; //$NON-NLS-1$ + + public static final String IMG_LCL_TYPE_NAMES = NAME_PREFIX + "tnames_co.gif"; //$NON-NLS-1$ + public static final String IMG_LCL_CHANGE_REGISTER_VALUE = NAME_PREFIX + "change_reg_value_co.gif"; //$NON-NLS-1$ /* * Set of predefined Image Descriptors. @@ -65,7 +70,7 @@ public class CDebugImages private static final String T_OBJ = "obj16"; //$NON-NLS-1$ private static final String T_OVR = "ovr16"; //$NON-NLS-1$ private static final String T_WIZBAN = "wizban"; //$NON-NLS-1$ - private static final String T_LCL = "clcl16"; //$NON-NLS-1$ + private static final String T_LCL = "lcl16"; //$NON-NLS-1$ private static final String T_CTOOL = "ctool16"; //$NON-NLS-1$ private static final String T_CVIEW = "cview16"; //$NON-NLS-1$ private static final String T_DTOOL = "dtool16"; //$NON-NLS-1$ @@ -83,6 +88,8 @@ public class CDebugImages public static final ImageDescriptor DESC_OBJS_VARIABLE_AGGREGATE = createManaged( T_OBJ, IMG_OBJS_VARIABLE_AGGREGATE ); public static final ImageDescriptor DESC_OBJS_VARIABLE_POINTER = createManaged( T_OBJ, IMG_OBJS_VARIABLE_POINTER ); public static final ImageDescriptor DESC_OBJS_VARIABLE_STRING = createManaged( T_OBJ, IMG_OBJS_VARIABLE_STRING ); + public static final ImageDescriptor DESC_OBJS_REGISTER_GROUP = createManaged( T_OBJ, IMG_OBJS_REGISTER_GROUP ); + public static final ImageDescriptor DESC_OBJS_REGISTER = createManaged( T_OBJ, IMG_OBJS_REGISTER ); /** * Returns the image managed under the given key in this registry. @@ -110,7 +117,7 @@ public class CDebugImages */ public static void setLocalImageDescriptors( IAction action, String iconName ) { - setImageDescriptors( action, "lcl16", iconName ); //$NON-NLS-1$ + setImageDescriptors( action, T_LCL, iconName ); } /* @@ -126,6 +133,7 @@ public class CDebugImages private static void setImageDescriptors( IAction action, String type, String relPath ) { + relPath = relPath.substring( NAME_PREFIX_LENGTH ); try { ImageDescriptor id = ImageDescriptor.createFromURL( makeIconFileURL( "d" + type, relPath ) ); //$NON-NLS-1$ diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ICDebugHelpContextIds.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ICDebugHelpContextIds.java index 079a07975ed..c0b9262f461 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ICDebugHelpContextIds.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ICDebugHelpContextIds.java @@ -22,10 +22,15 @@ public interface ICDebugHelpContextIds { public static final String PREFIX = ICDebugUIConstants.PLUGIN_ID + "."; //$NON-NLS-1$ + // Actions + public static final String CHANGE_REGISTER_VALUE_ACTION = PREFIX + "change_register_value_action_context"; //$NON-NLS-1$ + public static final String SHOW_TYPES_ACTION = PREFIX + "show_types_action_context"; //$NON-NLS-1$ + // Views public static final String REGISTERS_VIEW = PREFIX + "registers_view_context"; //$NON-NLS-1$ public static final String MEMORY_VIEW = PREFIX + "memory_view_context"; //$NON-NLS-1$ // Preference pages public static final String MEMORY_PREFERENCE_PAGE = PREFIX + "memory_preference_page_context"; //$NON-NLS-1$ + public static final String REGISTERS_PREFERENCE_PAGE = PREFIX + "registers_preference_page_context"; //$NON-NLS-1$ } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ChangeRegisterValueAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ChangeRegisterValueAction.java new file mode 100644 index 00000000000..d7827d03af3 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ChangeRegisterValueAction.java @@ -0,0 +1,43 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ +package org.eclipse.cdt.debug.internal.ui.actions; + +import org.eclipse.cdt.debug.internal.ui.CDebugImages; +import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; +import org.eclipse.debug.internal.ui.IDebugHelpContextIds; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.swt.custom.TreeEditor; +import org.eclipse.swt.widgets.Tree; +import org.eclipse.ui.actions.SelectionProviderAction; +import org.eclipse.ui.help.WorkbenchHelp; + +/** + * + * Enter type comment. + * + * @since Sep 16, 2002 + */ +public class ChangeRegisterValueAction extends SelectionProviderAction +{ + protected Tree fTree; + protected TreeEditor fTreeEditor; + + /** + * Constructor for ChangeRegisterValueAction. + * @param provider + * @param text + */ + public ChangeRegisterValueAction( Viewer viewer ) + { + super( viewer, "Change Register Value" ); + setDescription( "Change Register Value" ); + CDebugImages.setLocalImageDescriptors( this, CDebugImages.IMG_LCL_CHANGE_REGISTER_VALUE ); + fTree = ((TreeViewer)viewer).getTree(); + fTreeEditor = new TreeEditor( fTree ); + WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.CHANGE_REGISTER_VALUE_ACTION ); + } +} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowRegisterTypesAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowRegisterTypesAction.java new file mode 100644 index 00000000000..1e6c83b97fe --- /dev/null +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowRegisterTypesAction.java @@ -0,0 +1,91 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ +package org.eclipse.cdt.debug.internal.ui.actions; + +import org.eclipse.cdt.debug.internal.ui.CDebugImages; +import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; +import org.eclipse.cdt.debug.ui.CDebugUIPlugin; +import org.eclipse.debug.ui.IDebugModelPresentation; +import org.eclipse.jface.action.Action; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.StructuredViewer; +import org.eclipse.swt.custom.BusyIndicator; +import org.eclipse.ui.help.WorkbenchHelp; + +/** + * + * An action that toggles the state of a viewer to show/hide type names + * of registers. + * + * @since Sep 16, 2002 + */ +public class ShowRegisterTypesAction extends Action +{ + private StructuredViewer fViewer; + + /** + * Constructor for ShowRegisterTypesAction. + */ + public ShowRegisterTypesAction( StructuredViewer viewer ) + { + super( "Show &Type Names" ); + setViewer( viewer ); + setToolTipText( "Show Type Names" ); + CDebugImages.setLocalImageDescriptors( this, CDebugImages.IMG_LCL_TYPE_NAMES ); + setId( CDebugUIPlugin.getUniqueIdentifier() + ".ShowTypesAction" ); //$NON-NLS-1$ + WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.SHOW_TYPES_ACTION ); + } + + /** + * @see Action#run() + */ + public void run() + { + valueChanged( isChecked() ); + } + + private void valueChanged( boolean on ) + { + if ( getViewer().getControl().isDisposed() ) + { + return; + } + ILabelProvider labelProvider = (ILabelProvider)getViewer().getLabelProvider(); + if ( labelProvider instanceof IDebugModelPresentation ) + { + IDebugModelPresentation debugLabelProvider = (IDebugModelPresentation)labelProvider; + debugLabelProvider.setAttribute( IDebugModelPresentation.DISPLAY_VARIABLE_TYPE_NAMES, ( on ? Boolean.TRUE : Boolean.FALSE ) ); + BusyIndicator.showWhile( getViewer().getControl().getDisplay(), + new Runnable() + { + public void run() + { + getViewer().refresh(); + } + } ); + } + } + + /** + * @see Action#setChecked(boolean) + */ + public void setChecked( boolean value ) + { + super.setChecked( value ); + valueChanged( value ); + } + + protected StructuredViewer getViewer() + { + return fViewer; + } + + protected void setViewer( StructuredViewer viewer ) + { + fViewer = viewer; + } +} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/RegistersViewPreferencePage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/RegistersViewPreferencePage.java new file mode 100644 index 00000000000..bbe2e8e94be --- /dev/null +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/RegistersViewPreferencePage.java @@ -0,0 +1,100 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ +package org.eclipse.cdt.debug.internal.ui.preferences; + +import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; +import org.eclipse.cdt.debug.ui.CDebugUIPlugin; +import org.eclipse.cdt.debug.ui.ICDebugUIConstants; +import org.eclipse.debug.ui.IDebugUIConstants; +import org.eclipse.jface.preference.BooleanFieldEditor; +import org.eclipse.jface.preference.ColorFieldEditor; +import org.eclipse.jface.preference.FieldEditorPreferencePage; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.preference.PreferenceConverter; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.RGB; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; +import org.eclipse.ui.help.WorkbenchHelp; + +/** + * + * A page to set the preferences for the registers view + * + * @since Sep 16, 2002 + */ +public class RegistersViewPreferencePage extends FieldEditorPreferencePage + implements IWorkbenchPreferencePage +{ + /** + * Constructor for RegistersViewPreferencePage. + * @param style + */ + public RegistersViewPreferencePage() + { + super( GRID ); + setDescription( "Registers View Settings." ); + setPreferenceStore( CDebugUIPlugin.getDefault().getPreferenceStore() ); + } + + /** + * @see PreferencePage#createControl(Composite) + */ + public void createControl( Composite parent ) + { + super.createControl( parent ); + WorkbenchHelp.setHelp( parent, ICDebugHelpContextIds.REGISTERS_PREFERENCE_PAGE ); + } + + /* (non-Javadoc) + * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors() + */ + protected void createFieldEditors() + { + addField( new ColorFieldEditor( ICDebugPreferenceConstants.CHANGED_REGISTER_RGB, "&Changed register value color:", getFieldEditorParent() ) ); + + createSpacer( getFieldEditorParent(), 1 ); + + addField( new BooleanFieldEditor( IDebugUIConstants.PREF_SHOW_TYPE_NAMES, "Show type &names by default", SWT.NONE, getFieldEditorParent() ) ); + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IWorkbenchPreferencePage#init(IWorkbench) + */ + public void init( IWorkbench workbench ) + { + } + + public static void initDefaults( IPreferenceStore store ) + { + store.setDefault( IDebugUIConstants.PREF_SHOW_TYPE_NAMES, false ); + + PreferenceConverter.setDefault( store, + ICDebugPreferenceConstants.CHANGED_REGISTER_RGB, + new RGB( 255, 0, 0 ) ); + } + + protected void createSpacer( Composite composite, int columnSpan ) + { + Label label = new Label( composite, SWT.NONE ); + GridData gd = new GridData(); + gd.horizontalSpan = columnSpan; + label.setLayoutData( gd ); + } + + /** + * @see IPreferencePage#performOk() + */ + public boolean performOk() + { + boolean ok = super.performOk(); + CDebugUIPlugin.getDefault().savePluginPreferences(); + return ok; + } +} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryView.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryView.java index 66be3a1636a..2ae6d99ba9c 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryView.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryView.java @@ -10,7 +10,6 @@ import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler; import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandlerView; import org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler; import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.cdt.debug.ui.ICDebugUIConstants; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.model.IDebugElement; import org.eclipse.debug.core.model.IMemoryBlockRetrieval; @@ -18,6 +17,7 @@ import org.eclipse.debug.ui.IDebugModelPresentation; import org.eclipse.debug.ui.IDebugUIConstants; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.IToolBarManager; +import org.eclipse.jface.action.Separator; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.jface.viewers.IContentProvider; @@ -26,6 +26,7 @@ import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.Viewer; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.ISelectionListener; +import org.eclipse.ui.IWorkbenchActionConstants; import org.eclipse.ui.IWorkbenchPart; /** @@ -78,6 +79,7 @@ public class MemoryView extends AbstractDebugEventHandlerView */ protected void fillContextMenu( IMenuManager menu ) { + menu.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) ); } /* (non-Javadoc) diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersView.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersView.java index 500c336544e..0c911d14bce 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersView.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersView.java @@ -8,6 +8,8 @@ package org.eclipse.cdt.debug.internal.ui.views.registers; import org.eclipse.cdt.debug.internal.ui.CDTDebugModelPresentation; import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; +import org.eclipse.cdt.debug.internal.ui.actions.ChangeRegisterValueAction; +import org.eclipse.cdt.debug.internal.ui.actions.ShowRegisterTypesAction; import org.eclipse.cdt.debug.internal.ui.preferences.ICDebugPreferenceConstants; import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler; import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandlerView; @@ -17,8 +19,10 @@ import org.eclipse.cdt.debug.ui.ICDebugUIConstants; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.ui.IDebugModelPresentation; import org.eclipse.debug.ui.IDebugUIConstants; +import org.eclipse.jface.action.IAction; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.IToolBarManager; +import org.eclipse.jface.action.Separator; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.jface.viewers.IContentProvider; @@ -29,6 +33,7 @@ import org.eclipse.jface.viewers.Viewer; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.ISelectionListener; +import org.eclipse.ui.IWorkbenchActionConstants; import org.eclipse.ui.IWorkbenchPart; /** @@ -77,6 +82,15 @@ public class RegistersView extends AbstractDebugEventHandlerView */ protected void createActions() { + IAction action = new ShowRegisterTypesAction( getStructuredViewer() ); + action.setChecked( CDebugUIPlugin.getDefault().getPreferenceStore().getBoolean( IDebugUIConstants.PREF_SHOW_TYPE_NAMES ) ); + setAction( "ShowTypeNames", action ); //$NON-NLS-1$ + + action = new ChangeRegisterValueAction( getViewer() ); + action.setEnabled( false ); + setAction( "ChangeRegisterValue", action ); //$NON-NLS-1$ + setAction( DOUBLE_CLICK_ACTION, action ); + // set initial content here, as viewer has to be set setInitialContent(); } @@ -94,6 +108,14 @@ public class RegistersView extends AbstractDebugEventHandlerView */ protected void fillContextMenu( IMenuManager menu ) { + menu.add( new Separator( ICDebugUIConstants.EMPTY_REGISTER_GROUP ) ); + menu.add( new Separator( ICDebugUIConstants.REGISTER_GROUP ) ); + menu.add( getAction( "ChangeRegisterValue" ) ); //$NON-NLS-1$ + menu.add( new Separator( IDebugUIConstants.EMPTY_RENDER_GROUP ) ); + menu.add( new Separator( IDebugUIConstants.RENDER_GROUP ) ); + menu.add( getAction( "ShowTypeNames" ) ); //$NON-NLS-1$ + + menu.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) ); } /* (non-Javadoc) @@ -101,6 +123,9 @@ public class RegistersView extends AbstractDebugEventHandlerView */ protected void configureToolBar( IToolBarManager tbm ) { + tbm.add( new Separator( this.getClass().getName() ) ); + tbm.add( new Separator( IDebugUIConstants.RENDER_GROUP ) ); + tbm.add( getAction( "ShowTypeNames" ) ); //$NON-NLS-1$ } /* (non-Javadoc) diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersViewContentProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersViewContentProvider.java index 09d28739864..d99e7f3d6b4 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersViewContentProvider.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersViewContentProvider.java @@ -5,7 +5,15 @@ */ package org.eclipse.cdt.debug.internal.ui.views.registers; +import java.util.HashMap; + import org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler; +import org.eclipse.cdt.debug.ui.CDebugUIPlugin; +import org.eclipse.debug.core.DebugException; +import org.eclipse.debug.core.model.IRegisterGroup; +import org.eclipse.debug.core.model.IStackFrame; +import org.eclipse.debug.core.model.IValue; +import org.eclipse.debug.core.model.IVariable; import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.jface.viewers.Viewer; @@ -17,6 +25,15 @@ import org.eclipse.jface.viewers.Viewer; */ public class RegistersViewContentProvider implements ITreeContentProvider { + /** + * A table that maps children to their parent element + * such that this content provider can walk back up the + * parent chain (since values do not know their + * parent). + * Map of IVariable (child) -> IVariable (parent). + */ + private HashMap fParentCache; + /** * Handler for exceptions as content is retrieved */ @@ -27,15 +44,62 @@ public class RegistersViewContentProvider implements ITreeContentProvider */ public RegistersViewContentProvider() { - super(); + fParentCache = new HashMap( 10 ); } /* (non-Javadoc) * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(Object) */ - public Object[] getChildren( Object parentElement ) + public Object[] getChildren( Object parent ) { - return null; + Object[] children= null; + try + { + if ( parent instanceof IStackFrame ) + { + children = ((IStackFrame)parent).getRegisterGroups(); + } + else if ( parent instanceof IRegisterGroup ) + { + children = ((IRegisterGroup)parent).getRegisters(); + } + else if ( parent instanceof IVariable ) + { + children = ((IVariable)parent).getValue().getVariables(); + } + if ( children != null ) + { + cache( parent, children ); + return children; + } + } + catch( DebugException e ) + { + if ( getExceptionHandler() != null ) + { + getExceptionHandler().handleException( e ); + } + else + { + CDebugUIPlugin.log( e ); + } + } + return new Object[0]; + } + + /** + * Caches the given elememts as children of the given + * parent. + * + * @param parent parent element + * @param children children elements + */ + protected void cache( Object parent, Object[] children ) + { + for ( int i = 0; i < children.length; i++ ) + { + fParentCache.put( children[i], parent ); + } } /* (non-Javadoc) @@ -43,7 +107,7 @@ public class RegistersViewContentProvider implements ITreeContentProvider */ public Object getParent( Object element ) { - return null; + return fParentCache.get( element ); } /* (non-Javadoc) @@ -51,6 +115,30 @@ public class RegistersViewContentProvider implements ITreeContentProvider */ public boolean hasChildren( Object element ) { + try + { + if ( element instanceof IVariable ) + { + return ((IVariable)element).getValue().hasVariables(); + } + if ( element instanceof IValue ) + { + return ((IValue)element).hasVariables(); + } + if ( element instanceof IRegisterGroup ) + { + return ((IRegisterGroup)element).hasRegisters(); + } + if ( element instanceof IStackFrame ) + { + return ((IStackFrame)element).hasRegisterGroups(); + } + } + catch( DebugException e ) + { + CDebugUIPlugin.log( e ); + return false; + } return false; } @@ -67,13 +155,40 @@ public class RegistersViewContentProvider implements ITreeContentProvider */ public void dispose() { + fParentCache = null; + setExceptionHandler( null ); } + protected void clearCache() + { + if ( fParentCache != null ) + { + fParentCache.clear(); + } + } + + /** + * Remove the cached parent for the given children + * + * @param children for which to remove cached parents + */ + public void removeCache( Object[] children ) + { + if ( fParentCache != null ) + { + for ( int i = 0; i < children.length; i++ ) + { + fParentCache.remove( children[i] ); + } + } + } + /* (non-Javadoc) * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(Viewer, Object, Object) */ public void inputChanged( Viewer viewer, Object oldInput, Object newInput ) { + clearCache(); } /** diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java index 940ca33c882..5031cf5e28e 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java @@ -11,6 +11,7 @@ import org.eclipse.cdt.debug.internal.ui.CDTDebugModelPresentation; import org.eclipse.cdt.debug.internal.ui.CDebugImageDescriptorRegistry; import org.eclipse.cdt.debug.internal.ui.ColorManager; import org.eclipse.cdt.debug.internal.ui.preferences.MemoryViewPreferencePage; +import org.eclipse.cdt.debug.internal.ui.preferences.RegistersViewPreferencePage; import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; @@ -135,6 +136,7 @@ public class CDebugUIPlugin extends AbstractUIPlugin protected void initializeDefaultPreferences( IPreferenceStore pstore ) { MemoryViewPreferencePage.initDefaults( pstore ); + RegistersViewPreferencePage.initDefaults( pstore ); } public static CDTDebugModelPresentation getDebugModelPresentation() diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/ICDebugUIConstants.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/ICDebugUIConstants.java index 7af6bf6e79a..f9d859cad54 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/ICDebugUIConstants.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/ICDebugUIConstants.java @@ -37,4 +37,15 @@ public interface ICDebugUIConstants * Status code indicating an unexpected internal error. */ public static final int INTERNAL_ERROR = 150; + + /** + * Identifier for an empty group preceeding a + * register group in a menu (value "emptyRegisterGroup"). + */ + public static final String EMPTY_REGISTER_GROUP = "emptyRegisterGroup"; //$NON-NLS-1$ + + /** + * Identifier for a register group in a menu (value "registerGroup"). + */ + public static final String REGISTER_GROUP = "registerGroup"; //$NON-NLS-1$ }