Add architecture function for retrieving the stack growth direction.
Also add corresponding implementation for x86.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||
* Copyright 2011, Rene Gollent, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef ARCHITECTURE_H
|
||||
@@ -31,6 +32,12 @@ class Team;
|
||||
class TeamMemory;
|
||||
|
||||
|
||||
enum {
|
||||
STACK_GROWTH_DIRECTION_POSITIVE = 0,
|
||||
STACK_GROWTH_DIRECTION_NEGATIVE
|
||||
};
|
||||
|
||||
|
||||
class Architecture : public BReferenceable {
|
||||
public:
|
||||
Architecture(TeamMemory* teamMemory,
|
||||
@@ -44,6 +51,8 @@ public:
|
||||
inline bool IsBigEndian() const { return fBigEndian; }
|
||||
inline bool IsHostEndian() const;
|
||||
|
||||
virtual int32 StackGrowthDirection() const = 0;
|
||||
|
||||
virtual int32 CountRegisters() const = 0;
|
||||
virtual const Register* Registers() const = 0;
|
||||
virtual status_t InitRegisterRules(CfaContext& context) const;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||
* Copyright 2011, Rene Gollent, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
@@ -180,6 +181,13 @@ ArchitectureX86::Init()
|
||||
}
|
||||
|
||||
|
||||
int32
|
||||
ArchitectureX86::StackGrowthDirection() const
|
||||
{
|
||||
return STACK_GROWTH_DIRECTION_NEGATIVE;
|
||||
}
|
||||
|
||||
|
||||
int32
|
||||
ArchitectureX86::CountRegisters() const
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||
* Copyright 2011, Rene Gollent, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef ARCHITECTURE_X86_H
|
||||
@@ -22,6 +23,8 @@ public:
|
||||
|
||||
virtual status_t Init();
|
||||
|
||||
virtual int32 StackGrowthDirection() const;
|
||||
|
||||
virtual int32 CountRegisters() const;
|
||||
virtual const Register* Registers() const;
|
||||
virtual status_t InitRegisterRules(CfaContext& context) const;
|
||||
|
||||
Reference in New Issue
Block a user