public void  setLine(int offset, LineRecord line)
        {
            int i = offset - startOffset;

            if (lines[i] == null)
            {
                count++;
            }
            lines[i] = line;
        }
Exemplo n.º 2
0
        /// <summary> This is a callback function from LineFunctionContainer.combForLineRecords()
        /// We extract what we want and then update the associated module
        /// </summary>
        public virtual void  processLineRecord(ActionLocation where, LineRecord r)
        {
            int         line = r.lineno;
            String      func = (where.function == null)?null:where.function.name;
            DebugModule dm   = r.module;

            // locate the source file
            int     id = -1;
            DModule module;

            if (dm == null || where.at == -1)
            {
            }
            else if ((id = local2Global(dm.id)) < 0)
            {
            }
            else if ((module = m_manager.getSource(id)) == null)
            {
            }
            else
            {
                module.addLineFunctionInfo(where.actions.getOffset(where.at), line, func);
            }
        }
Exemplo n.º 3
0
		/// <summary> This is a callback function from LineFunctionContainer.combForLineRecords()
		/// We extract what we want and then update the associated module
		/// </summary>
		public virtual void  processLineRecord(ActionLocation where, LineRecord r)
		{
			int line = r.lineno;
			String func = (where.function == null)?null:where.function.name;
			DebugModule dm = r.module;
			
			// locate the source file
			int id = - 1;
			DModule module;
			
			if (dm == null || where.at == - 1)
			{
			}
			else if ((id = local2Global(dm.id)) < 0)
			{
			}
			else if ((module = m_manager.getSource(id)) == null)
			{
			}
			else
				module.addLineFunctionInfo(where.actions.getOffset(where.at), line, func);
		}
Exemplo n.º 4
0
		public void  setLine(int offset, LineRecord line)
		{
			int i = offset - startOffset;
			if (lines[i] == null)
				count++;
			lines[i] = line;
		}
Exemplo n.º 5
0
        private void  decodeAction(int opcode, int offset, ActionFactory factory)
        {
            LineRecord line = debug != null?debug.getLine(offset) : null;

            if (line != null)
            {
                factory.setLine(offset, line);
            }

            // interleave register records in the action list
            RegisterRecord record = (debug != null)?debug.getRegisters(offset):null;

            if (record != null)
            {
                factory.setRegister(offset, record);
            }

            Action a;

            if (opcode < 0x80)
            {
                a = ActionFactory.createAction(opcode);
                factory.setAction(offset, a);
                return;
            }

            int len = reader.readUI16();
            int pos = offset + 3;

            switch (opcode)
            {
            case Flash.Swf.ActionConstants.sactionDefineFunction:
                a = decodeDefineFunction(pos, len);
                factory.setAction(offset, a);
                return;


            case Flash.Swf.ActionConstants.sactionDefineFunction2:
                a = decodeDefineFunction2(pos, len);
                factory.setAction(offset, a);
                return;


            case Flash.Swf.ActionConstants.sactionWith:
                a = decodeWith(factory);
                break;


            case Flash.Swf.ActionConstants.sactionTry:
                a = decodeTry(factory);
                break;


            case Flash.Swf.ActionConstants.sactionPush:
                Push p = decodePush(offset, pos + len, factory);
                checkConsumed(pos, len, p);
                return;


            case Flash.Swf.ActionConstants.sactionStrictMode:
                a = decodeStrictMode();
                break;


            case Flash.Swf.ActionConstants.sactionCall:
                // this actions opcode has the high bit set, but there is no length.  considered a permanent bug.
                a = ActionFactory.createCall();
                break;


            case Flash.Swf.ActionConstants.sactionGotoFrame:
                a = decodeGotoFrame();
                break;


            case Flash.Swf.ActionConstants.sactionGetURL:
                a = decodeGetURL();
                break;


            case Flash.Swf.ActionConstants.sactionStoreRegister:
                a = decodeStoreRegister();
                break;


            case Flash.Swf.ActionConstants.sactionConstantPool:
                a = decodeConstantPool();
                break;


            case Flash.Swf.ActionConstants.sactionWaitForFrame:
                a = decodeWaitForFrame(opcode, factory);
                break;


            case Flash.Swf.ActionConstants.sactionSetTarget:
                a = decodeSetTarget();
                break;


            case Flash.Swf.ActionConstants.sactionGotoLabel:
                a = decodeGotoLabel();
                break;


            case Flash.Swf.ActionConstants.sactionWaitForFrame2:
                a = decodeWaitForFrame(opcode, factory);
                break;


            case Flash.Swf.ActionConstants.sactionGetURL2:
                a = decodeGetURL2();
                break;


            case Flash.Swf.ActionConstants.sactionJump:
            case Flash.Swf.ActionConstants.sactionIf:
                a = decodeBranch(opcode, factory);
                break;


            case Flash.Swf.ActionConstants.sactionGotoFrame2:
                a = decodeGotoFrame2();
                break;


            default:
                a = decodeUnknown(opcode, len);
                break;
            }
            checkConsumed(pos, len, a);
            factory.setAction(offset, a);
        }