Expose the stack pointer and frame pointer via CPUState.
This commit is contained in:
parent
7bdc07318d
commit
12b1aa817a
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||
* Copyright 2011, Rene Gollent, rene@gollent.com.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef CPU_STATE_H
|
||||
@ -21,6 +22,8 @@ public:
|
||||
virtual ~CpuState();
|
||||
|
||||
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,
|
||||
BVariant& _value) const = 0;
|
||||
virtual bool SetRegisterValue(const Register* reg,
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||
* Copyright 2011, Rene Gollent, rene@gollent.com.
|
||||
* 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
|
||||
CpuStateX86::GetRegisterValue(const Register* reg, BVariant& _value) const
|
||||
{
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||
* Copyright 2011, Rene Gollent, rene@gollent.com.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef CPU_STATE_X86_H
|
||||
@ -47,6 +48,8 @@ public:
|
||||
virtual ~CpuStateX86();
|
||||
|
||||
virtual target_addr_t InstructionPointer() const;
|
||||
virtual target_addr_t StackFramePointer() const;
|
||||
virtual target_addr_t StackPointer() const;
|
||||
virtual bool GetRegisterValue(const Register* reg,
|
||||
BVariant& _value) const;
|
||||
virtual bool SetRegisterValue(const Register* reg,
|
||||
|
Loading…
Reference in New Issue
Block a user