~ubuntu-branches/debian/sid/eclipse-cdt/sid

« back to all changes in this revision

Viewing changes to results/plugins/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIVarInfoExpressionInfo.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2011-10-06 21:15:04 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20111006211504-8dutmljjih0zikfv
Tags: 8.0.1-1
* New upstream release.
* Split the JNI packages into a separate architecture dependent
  package and made eclipse-cdt architecture independent.
* Install JNI libraries into multiarch aware location
* Bumped Standards-Version to 3.9.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*******************************************************************************
2
 
 * Copyright (c) 2000, 2006 QNX Software Systems and others.
3
 
 * All rights reserved. This program and the accompanying materials
4
 
 * are made available under the terms of the Eclipse Public License v1.0
5
 
 * which accompanies this distribution, and is available at
6
 
 * http://www.eclipse.org/legal/epl-v10.html
7
 
 *
8
 
 * Contributors:
9
 
 *     QNX Software Systems - Initial API and implementation
10
 
 *******************************************************************************/
11
 
package org.eclipse.cdt.dsf.mi.service.command.output;
12
 
 
13
 
/**
14
 
 * GDB/MI var-info-expression.
15
 
 */
16
 
public class MIVarInfoExpressionInfo extends MIInfo {
17
 
 
18
 
        String lang = ""; //$NON-NLS-1$
19
 
        String exp = ""; //$NON-NLS-1$
20
 
 
21
 
        public MIVarInfoExpressionInfo(MIOutput record) {
22
 
                super(record);
23
 
        if (isDone()) {
24
 
            MIOutput out = getMIOutput();
25
 
            MIResultRecord rr = out.getMIResultRecord();
26
 
            if (rr != null) {
27
 
                MIResult[] results =  rr.getMIResults();
28
 
                for (int i = 0; i < results.length; i++) {
29
 
                    String var = results[i].getVariable();
30
 
                    MIValue value = results[i].getMIValue();
31
 
                    String str = ""; //$NON-NLS-1$
32
 
                    if (value instanceof MIConst) {
33
 
                        str = ((MIConst)value).getString();
34
 
                    }
35
 
 
36
 
                    if (var.equals("lang")) { //$NON-NLS-1$
37
 
                        lang = str;
38
 
                    } else if (var.equals("exp")) { //$NON-NLS-1$
39
 
                        exp = str;
40
 
                    }
41
 
                }
42
 
            }
43
 
        }
44
 
        }
45
 
 
46
 
        public String getLanguage () {
47
 
                return lang;
48
 
        }
49
 
 
50
 
        public String getExpression() {
51
 
                return exp;
52
 
        }
53
 
}