libdebugger: Add accessor for cpu state size.
Architecture: - Store and provide accessor for the size in bytes of the low-level debug_cpu_state size of the respective target CPU. Adjust subclasses to pass in the appropriate size information.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||||
* Copyright 2011-2015, Rene Gollent, [email protected].
|
* Copyright 2011-2016, Rene Gollent, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef ARCHITECTURE_H
|
#ifndef ARCHITECTURE_H
|
||||||
@@ -50,12 +50,17 @@ enum {
|
|||||||
class Architecture : public BReferenceable {
|
class Architecture : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
Architecture(TeamMemory* teamMemory,
|
Architecture(TeamMemory* teamMemory,
|
||||||
uint8 addressSize, bool bigEndian);
|
uint8 addressSize,
|
||||||
|
size_t debugCpuStateSize,
|
||||||
|
bool bigEndian);
|
||||||
|
|
||||||
virtual ~Architecture();
|
virtual ~Architecture();
|
||||||
|
|
||||||
virtual status_t Init();
|
virtual status_t Init();
|
||||||
|
|
||||||
inline uint8 AddressSize() const { return fAddressSize; }
|
inline uint8 AddressSize() const { return fAddressSize; }
|
||||||
|
inline size_t DebugCpuStateSize() const
|
||||||
|
{ return fDebugCpuStateSize; }
|
||||||
|
|
||||||
inline bool IsBigEndian() const { return fBigEndian; }
|
inline bool IsBigEndian() const { return fBigEndian; }
|
||||||
inline bool IsHostEndian() const;
|
inline bool IsHostEndian() const;
|
||||||
@@ -136,6 +141,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
TeamMemory* fTeamMemory;
|
TeamMemory* fTeamMemory;
|
||||||
uint8 fAddressSize;
|
uint8 fAddressSize;
|
||||||
|
size_t fDebugCpuStateSize;
|
||||||
bool fBigEndian;
|
bool fBigEndian;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||||
|
* Copyright 2016, Rene Gollent, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -24,10 +25,11 @@
|
|||||||
|
|
||||||
|
|
||||||
Architecture::Architecture(TeamMemory* teamMemory, uint8 addressSize,
|
Architecture::Architecture(TeamMemory* teamMemory, uint8 addressSize,
|
||||||
bool bigEndian)
|
size_t debugCpuStateSize, bool bigEndian)
|
||||||
:
|
:
|
||||||
fTeamMemory(teamMemory),
|
fTeamMemory(teamMemory),
|
||||||
fAddressSize(addressSize),
|
fAddressSize(addressSize),
|
||||||
|
fDebugCpuStateSize(debugCpuStateSize),
|
||||||
fBigEndian(bigEndian)
|
fBigEndian(bigEndian)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009-2012, Ingo Weinhold, [email protected].
|
* Copyright 2009-2012, Ingo Weinhold, [email protected].
|
||||||
* Copyright 2011-2015, Rene Gollent, [email protected].
|
* Copyright 2011-2016, Rene Gollent, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ struct ArchitectureX86::FromDwarfRegisterMap : RegisterMap {
|
|||||||
|
|
||||||
ArchitectureX86::ArchitectureX86(TeamMemory* teamMemory)
|
ArchitectureX86::ArchitectureX86(TeamMemory* teamMemory)
|
||||||
:
|
:
|
||||||
Architecture(teamMemory, 4, false),
|
Architecture(teamMemory, 4, sizeof(x86_debug_cpu_state), false),
|
||||||
fFeatureFlags(0),
|
fFeatureFlags(0),
|
||||||
fAssemblyLanguage(NULL),
|
fAssemblyLanguage(NULL),
|
||||||
fToDwarfRegisterMap(NULL),
|
fToDwarfRegisterMap(NULL),
|
||||||
@@ -155,6 +155,9 @@ ArchitectureX86::Init()
|
|||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
#if defined(__INTEL__)
|
#if defined(__INTEL__)
|
||||||
|
// TODO: this needs to be determined/retrieved indirectly from the
|
||||||
|
// target host interface, as in the remote case the CPU features may
|
||||||
|
// differ from those of the local CPU.
|
||||||
cpuid_info info;
|
cpuid_info info;
|
||||||
status_t error = get_cpuid(&info, 1, 0);
|
status_t error = get_cpuid(&info, 1, 0);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012, Alex Smith, [email protected].
|
* Copyright 2012, Alex Smith, [email protected].
|
||||||
* Copyright 2009-2012, Ingo Weinhold, [email protected].
|
* Copyright 2009-2012, Ingo Weinhold, [email protected].
|
||||||
* Copyright 2011-2015, Rene Gollent, [email protected].
|
* Copyright 2011-2016, Rene Gollent, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ struct ArchitectureX8664::FromDwarfRegisterMap : RegisterMap {
|
|||||||
|
|
||||||
ArchitectureX8664::ArchitectureX8664(TeamMemory* teamMemory)
|
ArchitectureX8664::ArchitectureX8664(TeamMemory* teamMemory)
|
||||||
:
|
:
|
||||||
Architecture(teamMemory, 8, false),
|
Architecture(teamMemory, 8, sizeof(x86_64_debug_cpu_state), false),
|
||||||
fAssemblyLanguage(NULL),
|
fAssemblyLanguage(NULL),
|
||||||
fToDwarfRegisterMap(NULL),
|
fToDwarfRegisterMap(NULL),
|
||||||
fFromDwarfRegisterMap(NULL)
|
fFromDwarfRegisterMap(NULL)
|
||||||
|
|||||||
Reference in New Issue
Block a user