View | Details | Raw Unified | Return to bug 186256 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/dd/dsf/debug/ui/viewmodel/variable/VariableLocalsLayoutNode.java (-2 / +4 lines)
Lines 40-46 Link Here
40
import org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate;
40
import org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate;
41
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
41
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
42
42
43
@SuppressWarnings("restriction")
43
@SuppressWarnings({"restriction", "nls"})
44
public class VariableLocalsLayoutNode extends AbstractDMVMLayoutNode<IExpressionDMData> {
44
public class VariableLocalsLayoutNode extends AbstractDMVMLayoutNode<IExpressionDMData> {
45
45
46
    public VariableLocalsLayoutNode(AbstractVMProvider provider, DsfSession session) {
46
    public VariableLocalsLayoutNode(AbstractVMProvider provider, DsfSession session) {
Lines 91-100 Link Here
91
                        for (int idx = 0; idx < localColumns.length; idx++) {
91
                        for (int idx = 0; idx < localColumns.length; idx++) {
92
                            if (IDebugVMConstants.COLUMN_ID__NAME.equals(localColumns[idx])) {
92
                            if (IDebugVMConstants.COLUMN_ID__NAME.equals(localColumns[idx])) {
93
                                update.setLabel(getData().getName(), idx);
93
                                update.setLabel(getData().getName(), idx);
94
                            } else if (IDebugVMConstants.COLUMN_ID__TYPE.equals(localColumns[idx])) {
95
                                update.setLabel(getData().getTypeName(), idx);
94
                            } else if (IDebugVMConstants.COLUMN_ID__VALUE.equals(localColumns[idx])) {
96
                            } else if (IDebugVMConstants.COLUMN_ID__VALUE.equals(localColumns[idx])) {
95
                                weAreExtractingFormattedData = true;
97
                                weAreExtractingFormattedData = true;
96
                            } else if (IDebugVMConstants.COLUMN_ID__DESCRIPTION.equals(localColumns[idx])) {
98
                            } else if (IDebugVMConstants.COLUMN_ID__DESCRIPTION.equals(localColumns[idx])) {
97
                                update.setLabel("", idx); //$NON-NLS-1$
99
                                update.setLabel("", idx);
98
                            }
100
                            }
99
                        }
101
                        }
100
                        
102
                        
(-)src/org/eclipse/dd/dsf/debug/ui/viewmodel/variable/VariableSubExpressionsLayoutNode.java (+2 lines)
Lines 101-106 Link Here
101
                        for (int idx = 0; idx < localColumns.length; idx++) {
101
                        for (int idx = 0; idx < localColumns.length; idx++) {
102
                            if (IDebugVMConstants.COLUMN_ID__NAME.equals(localColumns[idx])) {
102
                            if (IDebugVMConstants.COLUMN_ID__NAME.equals(localColumns[idx])) {
103
                                update.setLabel(getData().getName(), idx);
103
                                update.setLabel(getData().getName(), idx);
104
                            } else if (IDebugVMConstants.COLUMN_ID__TYPE.equals(localColumns[idx])) {
105
                                update.setLabel(getData().getTypeName(), idx);
104
                            } else if (IDebugVMConstants.COLUMN_ID__VALUE.equals(localColumns[idx])) {
106
                            } else if (IDebugVMConstants.COLUMN_ID__VALUE.equals(localColumns[idx])) {
105
                                weAreExtractingFormattedData = true;
107
                                weAreExtractingFormattedData = true;
106
                            } else if (IDebugVMConstants.COLUMN_ID__DESCRIPTION.equals(localColumns[idx])) {
108
                            } else if (IDebugVMConstants.COLUMN_ID__DESCRIPTION.equals(localColumns[idx])) {
(-)src/org/eclipse/dd/dsf/debug/service/IExpressions.java (-14 / +7 lines)
Lines 23-28 Link Here
23
 * dependencies on the Modules service, RunControl service, and Stack service, as all may be used to
23
 * dependencies on the Modules service, RunControl service, and Stack service, as all may be used to
24
 * provide context for an expression to be evaluated.
24
 * provide context for an expression to be evaluated.
25
 */
25
 */
26
@SuppressWarnings("nls")
26
public interface IExpressions extends IDMService, IFormattedValues {
27
public interface IExpressions extends IDMService, IFormattedValues {
27
    
28
    
28
    /**
29
    /**
Lines 40-51 Link Here
40
        // These static fields define the possible return values of method getTypeId().  QUESTION: Why can't
41
        // These static fields define the possible return values of method getTypeId().  QUESTION: Why can't
41
        // these have type int?
42
        // these have type int?
42
        
43
        
43
        final static String TYPEID_UNKNOWN = "TYPEID_UNKNOWN";  //$NON-NLS-1$
44
        final static String TYPEID_UNKNOWN = "TYPEID_UNKNOWN";
44
        final static String TYPEID_INTEGER = "TYPEID_INTEGER";  //$NON-NLS-1$
45
        final static String TYPEID_INTEGER = "TYPEID_INTEGER";
45
        final static String TYPEID_CHAR = "TYPEID_CHAR";  //$NON-NLS-1$
46
        final static String TYPEID_CHAR = "TYPEID_CHAR";
46
        final static String TYPEID_FLOAT = "TYPEID_FLOAT";  //$NON-NLS-1$
47
        final static String TYPEID_FLOAT = "TYPEID_FLOAT";
47
        final static String TYPEID_DOUBLE = "TYPEID_DOUBLE";  //$NON-NLS-1$
48
        final static String TYPEID_DOUBLE = "TYPEID_DOUBLE";
48
        final static String TYPEID_OPAQUE = "TYPEID_OPAQUE";  //$NON-NLS-1$
49
        final static String TYPEID_OPAQUE = "TYPEID_OPAQUE";
49
        
50
        
50
        /**
51
        /**
51
         * This enumerates the possible basic types that an expression can have.
52
         * This enumerates the possible basic types that an expression can have.
Lines 99-112 Link Here
99
        int getBitCount();
100
        int getBitCount();
100
        
101
        
101
        /**
102
        /**
102
         * @return A string containing the value of the expression in a format that is natural for its type.
103
         *         For example, type "char" is shown as a single-quoted character, type "int" (and its cousins)
104
         *         is shown in decimal, type "unsigned int" (and its cousins) and pointers are shown in hex,
105
         *         floating point values are shown in non-scientific notation.
106
         */
107
        String getNaturalValue();
108
        
109
        /**
110
         * @return A string containing the value of the expression as returned by the debugger backend.
103
         * @return A string containing the value of the expression as returned by the debugger backend.
111
         */
104
         */
112
        String getStringValue();
105
        String getStringValue();
(-)src/org/eclipse/dd/dsf/mi/service/ExpressionService.java (-20 / +9 lines)
Lines 45-50 Link Here
45
 * This class implements a debugger expression evaluator as a DSF service.  The primary
45
 * This class implements a debugger expression evaluator as a DSF service.  The primary
46
 * interface that clients of this class should use is IExpressions.
46
 * interface that clients of this class should use is IExpressions.
47
 */
47
 */
48
@SuppressWarnings("nls")
48
public class ExpressionService extends AbstractDsfService implements IExpressions
49
public class ExpressionService extends AbstractDsfService implements IExpressions
49
{
50
{
50
    /**
51
    /**
Lines 108-119 Link Here
108
            return null; 
109
            return null; 
109
        }
110
        }
110
111
111
        public String getNaturalValue()
112
        {
113
            // ISSUE: Is this correct?
114
            return Integer.toString(Integer.parseInt(expressionValue, 10));
115
        }
116
117
        public IRegisterDMContext getRegister()
112
        public IRegisterDMContext getRegister()
118
        {
113
        {
119
            return null;
114
            return null;
Lines 134-149 Link Here
134
            return null;
129
            return null;
135
        }
130
        }
136
        
131
        
137
        /**
138
         * @see IExpressions.getArrayLength()
139
         */
140
        public long getArrayLength() {
132
        public long getArrayLength() {
141
            return -1;
133
            return -1;
142
        }
134
        }
143
        
135
        
144
        /**
145
         * @see IExpressions.getFields()
146
         */
147
        public Iterator<String> getFields() {
136
        public Iterator<String> getFields() {
148
            return null;
137
            return null;
149
        }
138
        }
Lines 162-168 Link Here
162
     */
151
     */
163
    private void doInitialize(RequestMonitor requestMonitor)
152
    private void doInitialize(RequestMonitor requestMonitor)
164
    {
153
    {
165
        fServiceDMC = new ServiceDMContext<ExpressionService>(this, "#expression"); //$NON-NLS-1$
154
        fServiceDMC = new ServiceDMContext<ExpressionService>(this, "#expression");
166
155
167
        // Obtain a reference to the MIRunControl object that enables this service to
156
        // Obtain a reference to the MIRunControl object that enables this service to
168
        // communication with GDB using the MI protocol.
157
        // communication with GDB using the MI protocol.
Lines 234-240 Link Here
234
                        };
223
                        };
235
224
236
                    // Create an MIVarEvaluateExpression command and have GDB execute it.
225
                    // Create an MIVarEvaluateExpression command and have GDB execute it.
237
                    DsfMIVarEvaluateExpression varEvalExpressionCmd = new DsfMIVarEvaluateExpression("expr"); //$NON-NLS-1$
226
                    DsfMIVarEvaluateExpression varEvalExpressionCmd = new DsfMIVarEvaluateExpression("expr");
238
227
239
                    fExpressionCache.execute(varEvalExpressionCmd, varEvalCallback);
228
                    fExpressionCache.execute(varEvalExpressionCmd, varEvalCallback);
240
                }
229
                }
Lines 242-248 Link Here
242
231
243
        // Create an MIVarCreate command and have GDB execute it.
232
        // Create an MIVarCreate command and have GDB execute it.
244
233
245
        DsfMIVarCreate varCreateCmd = new DsfMIVarCreate(null, "expr", dmc.getExpression()); //$NON-NLS-1$
234
        DsfMIVarCreate varCreateCmd = new DsfMIVarCreate(null, "expr", dmc.getExpression());
246
235
247
        fExpressionCache.execute(varCreateCmd, varCreateCallback);
236
        fExpressionCache.execute(varCreateCmd, varCreateCallback);
248
    }
237
    }
Lines 347-353 Link Here
347
        @Override
336
        @Override
348
        public String toString()
337
        public String toString()
349
        {
338
        {
350
            return baseToString() + ".expr[" + expression + "]"; //$NON-NLS-1$ //$NON-NLS-2$ $NON-NLS-2$
339
            return baseToString() + ".expr[" + expression + "]";
351
        }
340
        }
352
341
353
        /**
342
        /**
Lines 439-445 Link Here
439
            rm.done();
428
            rm.done();
440
        } else {
429
        } else {
441
            rm.setStatus(new Status(IStatus.ERROR, DsfMIPlugin.PLUGIN_ID, -1,
430
            rm.setStatus(new Status(IStatus.ERROR, DsfMIPlugin.PLUGIN_ID, -1,
442
                           "Unknown DMC type", null)); //$NON-NLS-1$
431
                           "Unknown DMC type", null));
443
            rm.done();
432
            rm.done();
444
        }
433
        }
445
    }
434
    }
Lines 525-543 Link Here
525
    public void getBaseExpressions(IExpressionDMContext exprContext,
514
    public void getBaseExpressions(IExpressionDMContext exprContext,
526
                                   DataRequestMonitor<IExpressionDMContext[]> rm)
515
                                   DataRequestMonitor<IExpressionDMContext[]> rm)
527
    {
516
    {
528
        rm.setStatus(new Status(IStatus.ERROR, DsfMIPlugin.PLUGIN_ID, NOT_SUPPORTED, "Not supported", null)); //$NON-NLS-1$
517
        rm.setStatus(new Status(IStatus.ERROR, DsfMIPlugin.PLUGIN_ID, NOT_SUPPORTED, "Not supported", null));
529
        rm.done();  
518
        rm.done();  
530
    }
519
    }
531
520
532
    public void getSubExpressions(IExpressionDMContext exprCtx,
521
    public void getSubExpressions(IExpressionDMContext exprCtx,
533
                                  DataRequestMonitor<Iterable<IExpressionDMContext>> rm)
522
                                  DataRequestMonitor<Iterable<IExpressionDMContext>> rm)
534
    {
523
    {
535
        rm.setStatus(new Status(IStatus.ERROR, DsfMIPlugin.PLUGIN_ID, NOT_SUPPORTED, "Not supported", null)); //$NON-NLS-1$
524
        rm.setStatus(new Status(IStatus.ERROR, DsfMIPlugin.PLUGIN_ID, NOT_SUPPORTED, "Not supported", null));
536
        rm.done();  
525
        rm.done();  
537
    }
526
    }
538
527
539
    public void getAvailableFormattedValues(IFormattedDataDMContext<?> dmc, DataRequestMonitor<String[]> rm) {
528
    public void getAvailableFormattedValues(IFormattedDataDMContext<?> dmc, DataRequestMonitor<String[]> rm) {
540
        rm.setStatus(new Status(IStatus.ERROR, DsfMIPlugin.PLUGIN_ID, NOT_SUPPORTED, "Not supported", null)); //$NON-NLS-1$
529
        rm.setStatus(new Status(IStatus.ERROR, DsfMIPlugin.PLUGIN_ID, NOT_SUPPORTED, "Not supported", null));
541
        rm.done();        
530
        rm.done();        
542
    }
531
    }
543
532

Return to bug 186256