Exemplo n.º 1
0
SyntaxTree::Node SyntaxTree:: read(StreamReader& reader)
{
   int type = reader.getDWord(-1);
   ref_t arg = reader.getDWord();
   int str = reader.getDWord();

   if (type == -1) {
      return Node();
   }
   else return Node(this, reader.Position(), (LexicalType)type, arg, str);
}
Exemplo n.º 2
0
bool DebugController :: loadDebugData(StreamReader& reader, bool setEntryAddress)
{
   if (setEntryAddress) {
      // read entry point
      _entryPoint = reader.getDWord();

      if (_entryPoint != 0)
         setEntryAddress = false;
   }

   IdentifierString reference;
   while (!reader.Eof()) {
      // read reference
      reader.readString(reference);

      // define the next record position
      int size = reader.getDWord() - 4;
      int nextPosition = reader.Position() + size;

      if (setEntryAddress) {
         // if entry address was not defined take the first one
         _entryPoint = reader.getDWord();

         reader.seek(reader.Position() - 4);
         setEntryAddress = false;
      }

   //   // if it is a VM temporal symbol and tape debugging as allowed
   //   if (ConstantIdentifier::compare(reference, TAPE_SYMBOL) && _debugTape) {
   //      loadTapeDebugInfo(reader, size);
   //   }
      // otherwise load standard debug info
   /*   else */loadSymbolDebugInfo(reference, reader);

      reader.seek(nextPosition);
   }

   return true;
}