Mono.Debugger.Backtrace.TryUnwind C# (CSharp) Method

TryUnwind() private method

private TryUnwind ( ThreadServant thread, TargetMemoryAccess memory, Mode mode, TargetAddress until ) : bool
thread Mono.Debugger.Backend.ThreadServant
memory TargetMemoryAccess
mode Mode
until TargetAddress
return bool
        internal bool TryUnwind(ThreadServant thread, TargetMemoryAccess memory,
					 Mode mode, TargetAddress until)
        {
            StackFrame new_frame = null;
            try {
                new_frame = last_frame.UnwindStack (memory);
            } catch (TargetException) {
            }

            if (!TryCallback (thread, memory, ref new_frame, true)) {
                if ((new_frame == null) || !IsFrameOkForMode (new_frame, mode)) {
                    if (!tried_lmf) {
                        tried_lmf = true;
                        if (thread.LMFAddress.IsNull)
                            return false;
                        lmf_address = memory.ReadAddress (thread.LMFAddress);
                    }

                    if (!lmf_address.IsNull)
                        new_frame = TryLMF (thread, memory);
                    else
                        return false;
                }
            }

            if (new_frame == null)
                return false;

            // Sanity check; don't loop.
            if (new_frame.StackPointer <= last_frame.StackPointer)
                return false;

            if (!until.IsNull && (new_frame.StackPointer >= until))
                return false;

            AddFrame (new_frame);
            return true;
        }