Expose the stack pointer and frame pointer via CPUState.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||||
|
* Copyright 2011, Rene Gollent, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef CPU_STATE_H
|
#ifndef CPU_STATE_H
|
||||||
@@ -21,6 +22,8 @@ public:
|
|||||||
virtual ~CpuState();
|
virtual ~CpuState();
|
||||||
|
|
||||||
virtual target_addr_t InstructionPointer() const = 0;
|
virtual target_addr_t InstructionPointer() const = 0;
|
||||||
|
virtual target_addr_t StackFramePointer() const = 0;
|
||||||
|
virtual target_addr_t StackPointer() const = 0;
|
||||||
virtual bool GetRegisterValue(const Register* reg,
|
virtual bool GetRegisterValue(const Register* reg,
|
||||||
BVariant& _value) const = 0;
|
BVariant& _value) const = 0;
|
||||||
virtual bool SetRegisterValue(const Register* reg,
|
virtual bool SetRegisterValue(const Register* reg,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||||
|
* Copyright 2011, Rene Gollent, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -54,6 +55,22 @@ CpuStateX86::InstructionPointer() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
target_addr_t
|
||||||
|
CpuStateX86::StackFramePointer() const
|
||||||
|
{
|
||||||
|
return IsRegisterSet(X86_REGISTER_EBP)
|
||||||
|
? IntRegisterValue(X86_REGISTER_EBP) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
target_addr_t
|
||||||
|
CpuStateX86::StackPointer() const
|
||||||
|
{
|
||||||
|
return IsRegisterSet(X86_REGISTER_ESP)
|
||||||
|
? IntRegisterValue(X86_REGISTER_ESP) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CpuStateX86::GetRegisterValue(const Register* reg, BVariant& _value) const
|
CpuStateX86::GetRegisterValue(const Register* reg, BVariant& _value) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||||
|
* Copyright 2011, Rene Gollent, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef CPU_STATE_X86_H
|
#ifndef CPU_STATE_X86_H
|
||||||
@@ -47,6 +48,8 @@ public:
|
|||||||
virtual ~CpuStateX86();
|
virtual ~CpuStateX86();
|
||||||
|
|
||||||
virtual target_addr_t InstructionPointer() const;
|
virtual target_addr_t InstructionPointer() const;
|
||||||
|
virtual target_addr_t StackFramePointer() const;
|
||||||
|
virtual target_addr_t StackPointer() const;
|
||||||
virtual bool GetRegisterValue(const Register* reg,
|
virtual bool GetRegisterValue(const Register* reg,
|
||||||
BVariant& _value) const;
|
BVariant& _value) const;
|
||||||
virtual bool SetRegisterValue(const Register* reg,
|
virtual bool SetRegisterValue(const Register* reg,
|
||||||
|
|||||||
Reference in New Issue
Block a user