• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# StackFrame类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中StackFrame的典型用法代码示例。如果您正苦于以下问题:C# StackFrame类的具体用法?C# StackFrame怎么用?C# StackFrame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



StackFrame类属于命名空间,在下文中一共展示了StackFrame类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: execute

        public override void execute(StackFrame frame)
        {
            long val1 = (long) frame.popOperand();
            long val2 = (long) frame.popOperand();

            frame.pushOperand(val1 & val2);
        }
开发者ID:jdewald,项目名称:toyvm,代码行数:7,代码来源:ByteCode_land.cs


示例2: execute

        // TODO: Actually implement threads
        public override void execute(StackFrame frame)
        {
            Heap.HeapReference heapRef = (Heap.HeapReference) frame.popOperand();

            ToyVMObject obj = (ToyVMObject) heapRef.obj;
            obj.monitorExit();
        }
开发者ID:jdewald,项目名称:toyvm,代码行数:8,代码来源:ByteCode_monitorexit.cs


示例3: WhoAmI

    public void WhoAmI(string arg1)
    {
        Assembly assembly = Assembly.GetExecutingAssembly();
        System.Type t = assembly.GetType(this.ToString());	// Get only this class
        Console.WriteLine("This class name is: {0}", t.ToString());
        MethodInfo[] mInfo = t.GetMethods();
        MemberInfo[] bInfo = t.GetMembers();
        FieldInfo[]  fInfo = t.GetFields();
        foreach (MethodInfo m in mInfo)
                Console.WriteLine("Method:  {0}", m.Name);
        foreach (MemberInfo b in bInfo)
                Console.WriteLine("Member:  {0}", b.Name);
        foreach (FieldInfo f in fInfo)
                Console.WriteLine("Field:  {0}", f.Name);

        StackFrame stackFrame = new StackFrame();
        MethodBase methodBase = stackFrame.GetMethod();
        Console.WriteLine("This method name is : {0}", methodBase.Name );

        /*System.Type[] types = assembly.GetTypes();
        foreach (System.Type t in types)
        {
            Console.WriteLine("Tipo: {0}", t.ToString());
            MethodInfo[] mInfo = t.GetMethods();
            MemberInfo[] bInfo = t.GetMembers();
            foreach (MethodInfo m in mInfo)
                    Console.WriteLine("Modulo:  {0}", m.Name);
            foreach (MemberInfo b in bInfo)
                    Console.WriteLine("Miembro:  {0}", b.Name);
        }*/
    }
开发者ID:BackupTheBerlios,项目名称:boxerp-svn,代码行数:31,代码来源:Info.cs


示例4: execute

        public override void execute(StackFrame frame)
        {
            if (depth > 0){
                throw new ToyVMException("Don't support dup2 with depth of " + depth,frame);
            }
            Object obj = frame.popOperand();
            Object obj2 = null;
            if (frame.hasMoreOperands()){
                obj2 = frame.popOperand();
            }

            /*System.Collections.Stack temp = new System.Collections.Stack();
            for (int i = 0; i < depth; i++){
                temp.Push(frame.popOperand());
            }
            frame.pushOperand(obj); // insert at depth depth

            while (temp.Count > 0){
                frame.pushOperand(temp.Pop());
            }
            */
            frame.pushOperand(obj); // put the duplicated one back on top
            if (obj2 != null){
                frame.pushOperand(obj2);
            }

            frame.pushOperand(obj); // put the duplicated one back on top
            if (obj2 != null){
                frame.pushOperand(obj2);
            }
        }
开发者ID:jdewald,项目名称:toyvm,代码行数:31,代码来源:ByteCode_dup2.cs


示例5: StackFrameNode

		public StackFrameNode(StackFrame stackFrame)
		{
			this.stackFrame = stackFrame;
			
			this.Name = stackFrame.MethodInfo.Name;
			this.ChildNodes = GetChildNodes();
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:7,代码来源:StackFrameNode.cs


示例6: execute

        public override void execute(StackFrame frame)
        {
            Object val2 = frame.popOperand();
            Object val1 = frame.popOperand();
            //Heap.HeapReference val2 = (Heap.HeapReference) frame.popOperand();
            //Heap.HeapReference val1 = (Heap.HeapReference) frame.popOperand();

            bool eval = false;
            switch (opval){
             case OP_EQ:{
                eval = (val1 == val2);

                break;
            }
            case OP_NE:{
                eval = (val1 != val2);
                break;
            }
            default: throw new ToyVMException("Not handling " + opval,frame);
            }

            if (eval){
                int pc = frame.getProgramCounter();
                frame.setProgramCounter(pc + branch - size);
            }
        }
开发者ID:jdewald,项目名称:toyvm,代码行数:26,代码来源:ByteCode_if_acmp.cs


示例7: execute

        public override void execute(StackFrame frame)
        {
            int val1 = (int) frame.popOperand();
            int val2 = (int) frame.popOperand();

            frame.pushOperand(val1 & val2);
        }
开发者ID:jdewald,项目名称:toyvm,代码行数:7,代码来源:ByteCode_iand.cs


示例8: GetLocation

 public TargetLocation GetLocation(StackFrame frame)
 {
     return (TargetLocation) frame.Thread.ThreadServant.DoTargetAccess (
         delegate (TargetMemoryAccess target)  {
             return GetLocation (frame, target);
     });
 }
开发者ID:baulig,项目名称:debugger,代码行数:7,代码来源:CapturedVariable.cs


示例9: execute

        public override void execute(StackFrame frame)
        {
            ClassFile clazz = ToyVMClassLoader.loadClass(method.GetClassInfo().getClassName());

            ConstantPoolInfo_NameAndType nameAndType = method.GetMethodNameAndType();
            if (log.IsDebugEnabled) log.DebugFormat("Will be executing {0} on {1}",nameAndType,clazz.GetName());
            MethodInfo methodInfo = clazz.getMethod(nameAndType);
            // TODO: Need better way of handling access to the method
            if (methodInfo == null){
                throw new ToyVMException("Unable to locate method " + nameAndType + " on " + clazz,frame);
            }
            StackFrame frame2 = new StackFrame(frame);

            int paramCount = method.getParameterCount();
            frame2.setMethod(clazz,methodInfo,paramCount);

            if (log.IsDebugEnabled) log.DebugFormat("Have {0} parameters",paramCount);
            // Store the parameters from the operand stack
            // into the local variables of the outgoing frame
            for (int i = paramCount; i > 0; i--){
                frame2.getLocalVariables()[i-1]=frame.popOperand();
                if (log.IsDebugEnabled) log.DebugFormat("Parameter {0} = {1}",i,frame2.getLocalVariables()[i-1]);
            }
            clazz.execute(nameAndType,frame2);
            /*methodInfo.execute(frame2);
            if (methodInfo != null){

            }
            else {
                throw new Exception("Unable to locate " + nameAndType.ToString());
            }
            */
        }
开发者ID:jdewald,项目名称:toyvm,代码行数:33,代码来源:ByteCode_invokestatic.cs


示例10: execute

        public override void execute(StackFrame frame)
        {
            double val1 = (double) frame.popOperand();
            double val2 = (double) frame.popOperand();

            frame.pushOperand(val2 - val1);
        }
开发者ID:jdewald,项目名称:toyvm,代码行数:7,代码来源:ByteCode_dsub.cs


示例11: GetObject

 // <summary>
 //   Retrieve an instance of this variable from the stack-frame @frame.
 //   May only be called if Type.HasObject is true.
 // </summary>
 // <remarks>
 //   An instance of IVariable contains information about a variable (for
 //   instance a parameter of local variable of a method), but it's not
 //   bound to any particular target location.  This also means that it won't
 //   get invalid after the target exited.
 // </remarks>
 public TargetObject GetObject(StackFrame frame)
 {
     return (TargetObject) frame.Thread.ThreadServant.DoTargetAccess (
         delegate (TargetMemoryAccess target)  {
             return GetObject (frame, target);
     });
 }
开发者ID:baulig,项目名称:debugger,代码行数:17,代码来源:TargetVariable.cs


示例12: execute

        public override void execute(StackFrame frame)
        {
            Object val = frame.popOperand();
            int index = (int) frame.popOperand();
            Heap.HeapReference heapRef = (Heap.HeapReference) frame.popOperand();

            if (! heapRef.isArray){
                throw new ToyVMException("Expected array, got " + heapRef,frame);
            }

            if (! heapRef.isPrimitive){
                ArrayList arr = (ArrayList) heapRef.obj;

                arr[index] = val;
            }
            else if (heapRef.primitiveType.Equals(Type.GetType("System.Char[]"))){
                ArrayList arr = (ArrayList) heapRef.obj;

                arr[index] = val;
                //System.Char[][] arr = (System.Char[][]) heapRef.obj;
                //Heap.HeapReference arrVal = (Heap.HeapReference)val;
                //arr[index] = (System.Char[])arrVal.obj;
            }
            else {
                throw new ToyVMException("Can't handle " + heapRef,frame);
            }
            if (log.IsDebugEnabled) log.DebugFormat("Stored {0} at index {1}",val,index);
        }
开发者ID:jdewald,项目名称:toyvm,代码行数:28,代码来源:ByteCode_aastore.cs


示例13: execute

        public override void execute(StackFrame frame)
        {
            float val1 = (float) frame.popOperand();
            float val2 = (float) frame.popOperand();

            frame.pushOperand(val1 + val2);
        }
开发者ID:jdewald,项目名称:toyvm,代码行数:7,代码来源:ByteCode_fadd.cs


示例14: GetFilteredFrames

        /// <summary>
        /// Filters and copies the specified array of .NET stack frames
        /// </summary>
        /// <param name="stackFrames"></param>
        /// <returns></returns>
        private StackFrame[] GetFilteredFrames(SysStackFrame[] stackFrames) {
            StackFrame[] result = null;

            int resultIndex = 0;
            for (int i = 0; i < stackFrames.Length; i++) {
                SysStackFrame current = stackFrames[i];

                // postpone allocating the array until we know how big it should be
                if (result == null) {
                    // filter the top irrelevant frames from the stack
                    if (!this._stackTraceFilter.IsRelevant(current)) {
                        continue;
                    }

                    result = new StackFrame[stackFrames.Length + MethodsToKeep - i];

                    // copy last frames to stack
                    for (int j = i-MethodsToKeep; j < i; j++) {
                        result[resultIndex] = StackFrame.Create(stackFrames[j]);
                        resultIndex++;
                    }

                }

                result[resultIndex] = StackFrame.Create(stackFrames[i]);
                resultIndex ++;
            }

            return result;
        }
开发者ID:julianpaulozzi,项目名称:EntityProfiler,代码行数:35,代码来源:StackTraceFactory.cs


示例15: Analyze

 protected override void Analyze(StackFrame frame, string framePointer)
 {
     EnsureRelativeUriWithUriBaseId(
         frame.Uri,
         frame.UriBaseId,
         framePointer);
 }
开发者ID:Microsoft,项目名称:sarif-sdk,代码行数:7,代码来源:UriBaseIdRequiresRelativeUri.cs


示例16: SoftEvaluationContext

        public SoftEvaluationContext(SoftDebuggerSession session, StackFrame frame, DC.EvaluationOptions options)
            : base(options)
        {
            Frame = frame;
            Thread = frame.Thread;
            Domain = frame.Domain;

            string method = frame.Method.Name;
            if (frame.Method.DeclaringType != null)
                method = frame.Method.DeclaringType.FullName + "." + method;
            var location = new DC.SourceLocation (method, frame.FileName, frame.LineNumber, frame.ColumnNumber, frame.EndLineNumber, frame.EndColumnNumber, frame.Location.SourceFileHash);
            string language;

            if (frame.Method != null) {
                language = frame.IsNativeTransition ? "Transition" : "Managed";
            } else {
                language = "Native";
            }

            Evaluator = session.GetEvaluator (new DC.StackFrame (frame.ILOffset, location, language, session.IsExternalCode (frame), true));
            Adapter = session.Adaptor;
            this.session = session;
            stackVersion = session.StackVersion;
            sourceAvailable = !string.IsNullOrEmpty (frame.FileName) && System.IO.File.Exists (frame.FileName);
        }
开发者ID:nerzhulart,项目名称:debugger-libs,代码行数:25,代码来源:SoftEvaluationContext.cs


示例17: execute

 public override void execute(StackFrame frame)
 {
     frame.popOperand();
     if (count == 2){
         frame.popOperand();
     }
 }
开发者ID:jdewald,项目名称:toyvm,代码行数:7,代码来源:ByteCode_pop.cs


示例18: execute

        public override void execute(StackFrame frame)
        {
            Object o = frame.popOperand();
            if (! (o is NullValue)){
                Heap.HeapReference heapRef = (Heap.HeapReference) o;

                // we only handle class right now
                ClassFile tClass = (ClassFile) heapRef.type;

                do {
                    if (tClass.GetName().Equals(className)){
                        frame.pushOperand(1);
                        return;
                    }

                    if (tClass.implements(className)){
                        frame.pushOperand(1);
                        return;
                    }
                    tClass = tClass.GetSuperClassFile();

                } while (tClass != null);

            }
            frame.pushOperand(0);
        }
开发者ID:jdewald,项目名称:toyvm,代码行数:26,代码来源:ByteCode_instanceof.cs


示例19: GetFrameLocals

        /// <summary>
        /// Gets the stack frame locals.
        /// </summary>
        /// <param name="stackFrame">The stack frame.</param>
        /// <param name="arguments">if set to <c>true</c> only arguments will be returned.</param>
        public VariableCollection GetFrameLocals(StackFrame stackFrame, bool arguments)
        {
            DebugScopeGroup scopeGroup = arguments ? DebugScopeGroup.Arguments : DebugScopeGroup.Locals;

            using (StackFrameSwitcher switcher = new StackFrameSwitcher(DbgEngDll.StateCache, stackFrame))
            {
                IDebugSymbolGroup2 symbolGroup;
                dbgEngDll.Symbols.GetScopeSymbolGroup2((uint)scopeGroup, null, out symbolGroup);
                uint localsCount = symbolGroup.GetNumberSymbols();
                Variable[] variables = new Variable[localsCount];
                for (uint i = 0; i < localsCount; i++)
                {
                    StringBuilder name = new StringBuilder(Constants.MaxSymbolName);
                    uint nameSize;

                    symbolGroup.GetSymbolName(i, name, (uint)name.Capacity, out nameSize);
                    var entry = symbolGroup.GetSymbolEntryInformation(i);
                    var module = stackFrame.Process.ModulesById[entry.ModuleBase];
                    var codeType = module.TypesById[entry.TypeId];
                    var address = entry.Offset;
                    var variableName = name.ToString();

                    variables[i] = Variable.CreateNoCast(codeType, address, variableName, variableName);
                }

                return new VariableCollection(variables);
            }
        }
开发者ID:southpolenator,项目名称:WinDbgCs,代码行数:33,代码来源:DbgEngSymbolProvider.cs


示例20: execute

        /**
         *
         * Operand stack
         * ..., objectref, [arg1, [arg2 ...]]  ...
         */
        public override void execute(StackFrame frame)
        {
            ClassFile clazz = ToyVMClassLoader.loadClass(method.GetClassInfo().getClassName());

            ConstantPoolInfo_NameAndType nameAndType = method.GetMethodNameAndType();
            if (log.IsDebugEnabled) log.DebugFormat("Will be executing {0} on {1}",nameAndType,clazz.GetName());
            MethodInfo methodInfo = clazz.getMethod(nameAndType);
            StackFrame frame2 = new StackFrame(frame);
            int paramCount = method.getParameterCount();
            frame2.setMethod(clazz,methodInfo,paramCount);

            if (log.IsDebugEnabled) log.DebugFormat("Have {0} parameters",paramCount);
            if (log.IsDebugEnabled) log.DebugFormat("Max Locals: {0}",methodInfo.getMaxLocals());
            // push "this" as local variable 0

            //frame2.setThis((ToyVMObject)(frame2.getLocalVariables()[0]));

            // Store the parameters from the operand stack
            // into the local variables of the outgoing frame
            for (int i = paramCount;i >= 0; i--){
                frame2.getLocalVariables()[i]=frame.popOperand();
                if (log.IsDebugEnabled) log.DebugFormat("Set variable {0}={1}",(i),frame2.getLocalVariables()[i]);
            }

            clazz.execute(nameAndType,frame2);

            //Environment.Exit(0);
        }
开发者ID:jdewald,项目名称:toyvm,代码行数:33,代码来源:ByteCode_invokespecial.cs



注:本文中的StackFrame类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# StackLayout类代码示例发布时间:2022-05-24
下一篇:
C# StackContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap