TiledArray::detail::MemoryWatchpoint_x86_64 Class Reference

Documentation

MemoryWatchpoint represents a hardware watchpoint for a memory location Implements a memory watchpoint on x86 ... only implemented for macOS so far this is a slightly tweaked version of https://m.habrahabr.ru/post/103073/ see also http://www.sandpile.org/x86/drx.htm for the x86 debugging register map.

Definition at line 51 of file bug.h.

Classes

class  Pool
 a singleton pool of MemoryWatchpoint objects More...
 

Public Types

enum  DebugRegister { kDR0 = 0, kDR1 = 1, kDR2 = 2, kDR3 = 3 }
 
enum  Size { kByte = 0, kHalfWord = 1, kWord = 3, kSizeMask = 3 }
 
enum  BreakState { kDisabled = 0, kEnabledLocally = 1, kEnabledGlobally = 2, kBreakStateMask = 3 }
 
enum  Condition { kWhenExecuted = 0, kWhenWritten = 1, kWhenWrittenOrRead = 3, kConditionMask = 3 }
 

Public Member Functions

 MemoryWatchpoint_x86_64 (void *addr, Size size, Condition cond, DebugRegister dr, const pthread_t *thread)
 creates a MemoryWatchpoint watching memory window [addr,addr+size) for condition cond from threads threads More...
 
 ~MemoryWatchpoint_x86_64 ()
 
void * address () const
 
Size size () const
 
Condition condition () const
 
DebugRegister debug_register () const
 

Friends

class MemoryWatchPool
 

Member Enumeration Documentation

◆ BreakState

Enumerator
kDisabled 
kEnabledLocally 
kEnabledGlobally 
kBreakStateMask 

Definition at line 66 of file bug.h.

◆ Condition

Enumerator
kWhenExecuted 
kWhenWritten 
kWhenWrittenOrRead 
kConditionMask 

Definition at line 73 of file bug.h.

◆ DebugRegister

Enumerator
kDR0 
kDR1 
kDR2 
kDR3 

Definition at line 55 of file bug.h.

◆ Size

Enumerator
kByte 
kHalfWord 
kWord 
kSizeMask 

Definition at line 57 of file bug.h.

Constructor & Destructor Documentation

◆ MemoryWatchpoint_x86_64()

TiledArray::detail::MemoryWatchpoint_x86_64::MemoryWatchpoint_x86_64 ( void *  addr,
Size  size,
Condition  cond,
DebugRegister  dr,
const pthread_t *  thread 
)
inline

creates a MemoryWatchpoint watching memory window [addr,addr+size) for condition cond from threads threads

Parameters
[in]addrthe beginning of the memory window
[in]sizethe size of the memory window
[in]condthe condition to watch for
[in]drthe debugging register to use
[in]threadsthe set of threads to watch
Exceptions
std::runtime_errorif setting the watchpoint fails (either due to the lack of available registers or another reason)

Definition at line 189 of file bug.h.

◆ ~MemoryWatchpoint_x86_64()

TiledArray::detail::MemoryWatchpoint_x86_64::~MemoryWatchpoint_x86_64 ( )
inline

Definition at line 195 of file bug.h.

Member Function Documentation

◆ address()

void* TiledArray::detail::MemoryWatchpoint_x86_64::address ( ) const
inline

Definition at line 197 of file bug.h.

◆ condition()

Condition TiledArray::detail::MemoryWatchpoint_x86_64::condition ( ) const
inline

Definition at line 199 of file bug.h.

◆ debug_register()

DebugRegister TiledArray::detail::MemoryWatchpoint_x86_64::debug_register ( ) const
inline

Definition at line 200 of file bug.h.

◆ size()

Size TiledArray::detail::MemoryWatchpoint_x86_64::size ( ) const
inline

Definition at line 198 of file bug.h.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ MemoryWatchPool

friend class MemoryWatchPool
friend

Definition at line 219 of file bug.h.


The documentation for this class was generated from the following file: