ttg::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 50 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 64 of file bug.h.

◆ Condition

Enumerator
kWhenExecuted 
kWhenWritten 
kWhenWrittenOrRead 
kConditionMask 

Definition at line 71 of file bug.h.

◆ DebugRegister

Enumerator
kDR0 
kDR1 
kDR2 
kDR3 

Definition at line 54 of file bug.h.

◆ Size

Enumerator
kByte 
kHalfWord 
kWord 
kSizeMask 

Definition at line 56 of file bug.h.

Constructor & Destructor Documentation

◆ MemoryWatchpoint_x86_64()

ttg::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]threadthe thread to watch
Exceptions
std::runtime_errorif setting the watchpoint fails (either due to the lack of available registers or another reason)

Definition at line 184 of file bug.h.

◆ ~MemoryWatchpoint_x86_64()

ttg::detail::MemoryWatchpoint_x86_64::~MemoryWatchpoint_x86_64 ( )
inline

Definition at line 189 of file bug.h.

Member Function Documentation

◆ address()

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

Definition at line 191 of file bug.h.

◆ condition()

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

Definition at line 193 of file bug.h.

◆ debug_register()

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

Definition at line 194 of file bug.h.

◆ size()

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

Definition at line 192 of file bug.h.

Friends And Related Function Documentation

◆ MemoryWatchPool

friend class MemoryWatchPool
friend

Definition at line 210 of file bug.h.


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