Mono.Debugger.Backend.Bfd.GetTrampoline C# (CSharp) Method

GetTrampoline() private method

private GetTrampoline ( TargetMemoryAccess memory, TargetAddress address, TargetAddress &trampoline, bool &is_start ) : bool
memory Mono.Debugger.TargetMemoryAccess
address Mono.Debugger.TargetAddress
trampoline Mono.Debugger.TargetAddress
is_start bool
return bool
        internal bool GetTrampoline(TargetMemoryAccess memory, TargetAddress address,
					     out TargetAddress trampoline, out bool is_start)
        {
            if (!has_got || (address < plt_start) || (address > plt_end)) {
                is_start = false;
                trampoline = TargetAddress.Null;
                return false;
            }

            Instruction target_insn = Architecture.ReadInstruction (memory, address);
            if ((target_insn == null) || !target_insn.HasInstructionSize ||
                ((target_insn.InstructionType != Instruction.Type.Jump) &&
                 (target_insn.InstructionType != Instruction.Type.IndirectJump))) {
                is_start = false;
                trampoline = TargetAddress.Null;
                return false;
            }

            TargetAddress call_target = target_insn.GetEffectiveAddress (memory);
            if (call_target.IsNull) {
                is_start = false;
                trampoline = TargetAddress.Null;
                return false;
            }

            if (call_target != address + target_insn.InstructionSize) {
                is_start = false;
                trampoline = call_target;
                return true;
            }

            is_start = true;
            trampoline = memory.ReadAddress (got_start + 3 * info.TargetAddressSize);
            return true;
        }