Mono.Debugger.Method.UnwindStack C# (CSharp) Method

UnwindStack() private method

private UnwindStack ( StackFrame frame, TargetMemoryAccess memory ) : StackFrame
frame StackFrame
memory TargetMemoryAccess
return StackFrame
        internal StackFrame UnwindStack(StackFrame frame, TargetMemoryAccess memory)
        {
            if (!IsLoaded)
                return null;

            try {
                StackFrame new_frame = Module.UnwindStack (frame, memory);
                if (new_frame != null)
                    return new_frame;
            } catch {
            }

            int prologue_size;
            if (HasMethodBounds)
                prologue_size = (int) (MethodStartAddress - StartAddress);
            else
                prologue_size = (int) (EndAddress - StartAddress);
            int offset = (int) (frame.TargetAddress - StartAddress);

            byte[] prologue = memory.ReadBuffer (StartAddress, prologue_size);
            return frame.Thread.Architecture.UnwindStack (frame, memory, prologue, offset);
        }

Usage Example

示例#1
0
        internal StackFrame UnwindStack(TargetMemoryAccess memory)
        {
            if (parent_frame != null)
            {
                return(parent_frame);
            }

            StackFrame new_frame = null;

            if (method != null)
            {
                try {
                    new_frame = method.UnwindStack(this, memory);
                } catch (TargetException) {
                }

                if (new_frame != null)
                {
                    return(new_frame);
                }
            }

            foreach (Module module in thread.Process.Modules)
            {
                try {
                    new_frame = module.UnwindStack(this, memory);
                } catch {
                    continue;
                }
                if (new_frame != null)
                {
                    return(new_frame);
                }
            }

            return(thread.Architecture.UnwindStack(this, memory, null, 0));
        }