Add watchpoint capabilities hook to Architecture.
Will be used by the watchpoint manager and/or watchpoint UI to present and/or handle the relative limitations of the current platform.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||||
* Copyright 2011, Rene Gollent, [email protected].
|
* Copyright 2011-2012, 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
|
||||||
@@ -38,6 +38,12 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
enum {
|
||||||
|
WATCHPOINT_CAPABILITY_FLAG_READ = 1,
|
||||||
|
WATCHPOINT_CAPABILITY_FLAG_WRITE = 2
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class Architecture : public BReferenceable {
|
class Architecture : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
Architecture(TeamMemory* teamMemory,
|
Architecture(TeamMemory* teamMemory,
|
||||||
@@ -105,6 +111,11 @@ public:
|
|||||||
bool useExistingTrace = false);
|
bool useExistingTrace = false);
|
||||||
// team is not locked
|
// team is not locked
|
||||||
|
|
||||||
|
virtual status_t GetWatchpointDebugCapabilities(
|
||||||
|
int32& _maxRegisterCount,
|
||||||
|
uint8& _watchpointCapabilityFlags) = 0;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
TeamMemory* fTeamMemory;
|
TeamMemory* fTeamMemory;
|
||||||
uint8 fAddressSize;
|
uint8 fAddressSize;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009-2012, Ingo Weinhold, [email protected].
|
* Copyright 2009-2012, Ingo Weinhold, [email protected].
|
||||||
* Copyright 2011, Rene Gollent, [email protected].
|
* Copyright 2011-2012, Rene Gollent, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -611,6 +611,22 @@ ArchitectureX86::GetInstructionInfo(target_addr_t address,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
ArchitectureX86::GetWatchpointDebugCapabilities(int32& _maxRegisterCount,
|
||||||
|
uint8& _watchpointCapabilityFlags)
|
||||||
|
{
|
||||||
|
// while x86 technically has 4 hardware debug registers, one is reserved by
|
||||||
|
// the kernel, and one is required for breakpoint support, which leaves
|
||||||
|
// two available for watchpoints.
|
||||||
|
_maxRegisterCount = 2;
|
||||||
|
|
||||||
|
// x86 only supports write watchpoints.
|
||||||
|
_watchpointCapabilityFlags = WATCHPOINT_CAPABILITY_FLAG_WRITE;
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ArchitectureX86::_AddRegister(int32 index, const char* name,
|
ArchitectureX86::_AddRegister(int32 index, const char* name,
|
||||||
uint32 bitSize, uint32 valueType, register_type type, bool calleePreserved)
|
uint32 bitSize, uint32 valueType, register_type type, bool calleePreserved)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||||
* Copyright 2011, Rene Gollent, [email protected].
|
* Copyright 2011-2012, Rene Gollent, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef ARCHITECTURE_X86_H
|
#ifndef ARCHITECTURE_X86_H
|
||||||
@@ -23,7 +23,7 @@ public:
|
|||||||
|
|
||||||
virtual status_t Init();
|
virtual status_t Init();
|
||||||
|
|
||||||
virtual int32 StackGrowthDirection() const;
|
virtual int32 StackGrowthDirection() const;
|
||||||
|
|
||||||
virtual int32 CountRegisters() const;
|
virtual int32 CountRegisters() const;
|
||||||
virtual const Register* Registers() const;
|
virtual const Register* Registers() const;
|
||||||
@@ -61,6 +61,10 @@ public:
|
|||||||
virtual status_t GetInstructionInfo(target_addr_t address,
|
virtual status_t GetInstructionInfo(target_addr_t address,
|
||||||
InstructionInfo& _info);
|
InstructionInfo& _info);
|
||||||
|
|
||||||
|
virtual status_t GetWatchpointDebugCapabilities(
|
||||||
|
int32& _maxRegisterCount,
|
||||||
|
uint8& _watchpointCapabilityFlags);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct ToDwarfRegisterMap;
|
struct ToDwarfRegisterMap;
|
||||||
struct FromDwarfRegisterMap;
|
struct FromDwarfRegisterMap;
|
||||||
|
|||||||
Reference in New Issue
Block a user