Search in sources :

Example 6 with CReference

use of com.google.security.zynamics.binnavi.disassembly.CReference in project binnavi by google.

the class CCodeNodeParser method parseReferences.

/**
   * Parses the outgoing references of an operand expression.
   *
   * @param expressionId The expression ID of the operand expression.
   * @param dataset Provides the reference data.
   *
   * @return The outgoing references of the operand expression.
   *
   * @throws ParserException Thrown if the reference data could not be read.
   */
private static List<CReference> parseReferences(final int expressionId, final ICodeNodeProvider dataset) throws ParserException {
    final List<CReference> references = new ArrayList<CReference>();
    boolean hasReferences = false;
    do {
        final CReference reference = dataset.getReference();
        if (reference == null) {
            if (hasReferences) {
                dataset.prev();
            }
            break;
        }
        hasReferences = true;
        final int currentExpressionId = dataset.getExpressionTreeId();
        if (expressionId != currentExpressionId) {
            dataset.prev();
            break;
        }
        references.add(reference);
    } while (dataset.next());
    return references;
}
Also used : ArrayList(java.util.ArrayList) CReference(com.google.security.zynamics.binnavi.disassembly.CReference)

Aggregations

CReference (com.google.security.zynamics.binnavi.disassembly.CReference)6 CAddress (com.google.security.zynamics.zylib.disassembly.CAddress)4 MockSqlProvider (com.google.security.zynamics.binnavi.Database.MockClasses.MockSqlProvider)2 ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2 Reference (com.google.security.zynamics.binnavi.API.disassembly.Reference)1 SQLProvider (com.google.security.zynamics.binnavi.Database.Interfaces.SQLProvider)1 MockCodeNodeData (com.google.security.zynamics.binnavi.Database.MockClasses.MockCodeNodeData)1 MockCodeNodeProvider (com.google.security.zynamics.binnavi.Database.MockClasses.MockCodeNodeProvider)1 MockDatabase (com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase)1 MockDatabaseManager (com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabaseManager)1 CCodeNodeParser (com.google.security.zynamics.binnavi.Database.NodeParser.CCodeNodeParser)1 CTag (com.google.security.zynamics.binnavi.Tagging.CTag)1 CallGraphSettingsConfigItem (com.google.security.zynamics.binnavi.config.CallGraphSettingsConfigItem)1 CCodeNode (com.google.security.zynamics.binnavi.disassembly.CCodeNode)1 COperandTree (com.google.security.zynamics.binnavi.disassembly.COperandTree)1 COperandTreeNode (com.google.security.zynamics.binnavi.disassembly.COperandTreeNode)1 INaviCodeNode (com.google.security.zynamics.binnavi.disassembly.INaviCodeNode)1 INaviEdge (com.google.security.zynamics.binnavi.disassembly.INaviEdge)1 INaviInstruction (com.google.security.zynamics.binnavi.disassembly.INaviInstruction)1