LLDB mainline
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
lldb_private::WatchpointResource Class Reference

#include <WatchpointResource.h>

Inheritance diagram for lldb_private::WatchpointResource:
Inheritance graph
[legend]

Public Types

typedef lldb::wp_resource_id_t SiteID
 
typedef lldb::watch_id_t ConstituentID
 
typedef std::vector< lldb::WatchpointSPWatchpointCollection
 
typedef LockingAdaptedIterable< WatchpointCollection, lldb::WatchpointSP, vector_adapter, std::mutex > WatchpointIterable
 

Public Member Functions

 WatchpointResource (lldb::addr_t addr, size_t size, bool read, bool write)
 
 ~WatchpointResource ()
 
lldb::addr_t GetLoadAddress () const
 
size_t GetByteSize () const
 
bool WatchpointResourceRead () const
 
bool WatchpointResourceWrite () const
 
void SetType (bool read, bool write)
 
WatchpointIterable Constituents ()
 Iterate over the watchpoint constituents for this resource.
 
bool ShouldStop (StoppointCallbackContext *context)
 Enquires of the atchpoints that produced this watchpoint resource whether we should stop at this location.
 
void Dump (Stream *s) const
 Standard Dump method.
 
void AddConstituent (const lldb::WatchpointSP &constituent)
 The "Constituents" are the watchpoints that share this resource.
 
void RemoveConstituent (lldb::WatchpointSP &constituent)
 The method removes the constituent at constituent from this watchpoint resource.
 
size_t GetNumberOfConstituents ()
 This method returns the number of Watchpoints currently using watchpoint resource.
 
lldb::WatchpointSP GetConstituentAtIndex (size_t idx)
 This method returns the Watchpoint at index index using this Resource.
 
bool ConstituentsContains (const lldb::WatchpointSP &wp_sp)
 Check if the constituents includes a watchpoint.
 
bool ConstituentsContains (const lldb_private::Watchpoint *wp)
 Check if the constituents includes a watchpoint.
 
WatchpointCollection CopyConstituentsList ()
 This method copies the watchpoint resource's constituents into a new collection.
 
lldb::wp_resource_id_t GetID () const
 
bool Contains (lldb::addr_t addr)
 

Protected Member Functions

void BumpHitCounts ()
 

Private Member Functions

 WatchpointResource (const WatchpointResource &)=delete
 
const WatchpointResourceoperator= (const WatchpointResource &)=delete
 

Static Private Member Functions

static lldb::wp_resource_id_t GetNextID ()
 

Private Attributes

lldb::wp_resource_id_t m_id
 
lldb::addr_t m_addr
 
size_t m_size
 
bool m_watch_read
 
bool m_watch_write
 
WatchpointCollection m_constituents
 The Watchpoints which own this resource.
 
std::mutex m_constituents_mutex
 This mutex protects the constituents collection.
 

Friends

class StopInfoWatchpoint
 

Detailed Description

Definition at line 20 of file WatchpointResource.h.

Member Typedef Documentation

◆ ConstituentID

Definition at line 29 of file WatchpointResource.h.

◆ SiteID

Definition at line 28 of file WatchpointResource.h.

◆ WatchpointCollection

Definition at line 41 of file WatchpointResource.h.

◆ WatchpointIterable

Definition at line 44 of file WatchpointResource.h.

Constructor & Destructor Documentation

◆ WatchpointResource() [1/2]

WatchpointResource::WatchpointResource ( lldb::addr_t  addr,
size_t  size,
bool  read,
bool  write 
)

Definition at line 19 of file WatchpointResource.cpp.

◆ ~WatchpointResource()

WatchpointResource::~WatchpointResource ( )

Definition at line 24 of file WatchpointResource.cpp.

References m_constituents, and m_constituents_mutex.

◆ WatchpointResource() [2/2]

lldb_private::WatchpointResource::WatchpointResource ( const WatchpointResource )
privatedelete

Member Function Documentation

◆ AddConstituent()

void WatchpointResource::AddConstituent ( const lldb::WatchpointSP constituent)

The "Constituents" are the watchpoints that share this resource.

The method adds the constituent to this resource's constituent list.

Parameters
[in]constituentconstituent is the Wachpoint to add.

Definition at line 52 of file WatchpointResource.cpp.

References m_constituents, and m_constituents_mutex.

◆ BumpHitCounts()

void lldb_private::WatchpointResource::BumpHitCounts ( )
protected

◆ Constituents()

WatchpointIterable lldb_private::WatchpointResource::Constituents ( )
inline

Iterate over the watchpoint constituents for this resource.

Returns
An Iterable object which can be used to loop over the watchpoints that are constituents of this resource.

Definition at line 51 of file WatchpointResource.h.

References m_constituents, and m_constituents_mutex.

◆ ConstituentsContains() [1/2]

bool WatchpointResource::ConstituentsContains ( const lldb::WatchpointSP wp_sp)

Check if the constituents includes a watchpoint.

Parameters
[in]wp_spThe WatchpointSP to search for.
Returns
true if this resource's constituents includes the watchpoint.

Definition at line 70 of file WatchpointResource.cpp.

References ConstituentsContains().

Referenced by ConstituentsContains().

◆ ConstituentsContains() [2/2]

bool WatchpointResource::ConstituentsContains ( const lldb_private::Watchpoint wp)

Check if the constituents includes a watchpoint.

Parameters
[in]wpThe Watchpoint to search for.
Returns
true if this resource's constituents includes the watchpoint.

Definition at line 74 of file WatchpointResource.cpp.

References m_constituents, and m_constituents_mutex.

◆ Contains()

bool WatchpointResource::Contains ( lldb::addr_t  addr)

Definition at line 46 of file WatchpointResource.cpp.

References m_addr, and m_size.

◆ CopyConstituentsList()

WatchpointResource::WatchpointCollection WatchpointResource::CopyConstituentsList ( )

This method copies the watchpoint resource's constituents into a new collection.

It does this while the constituents mutex is locked.

Returns
A copy of the Watchpoints which own this resource.

Definition at line 92 of file WatchpointResource.cpp.

References m_constituents, and m_constituents_mutex.

◆ Dump()

void WatchpointResource::Dump ( Stream s) const

Standard Dump method.

Definition at line 116 of file WatchpointResource.cpp.

References m_addr, m_size, and lldb_private::Stream::Printf().

◆ GetByteSize()

size_t WatchpointResource::GetByteSize ( ) const

Definition at line 31 of file WatchpointResource.cpp.

References m_size.

◆ GetConstituentAtIndex()

WatchpointSP WatchpointResource::GetConstituentAtIndex ( size_t  idx)

This method returns the Watchpoint at index index using this Resource.

The constituents are listed ordinally from 0 to GetNumberOfConstituents() - 1 so you can use this method to iterate over the constituents.

Parameters
[in]idxThe index in the list of constituents for which you wish the constituent location.
Returns
The Watchpoint at that index.

Definition at line 82 of file WatchpointResource.cpp.

References m_constituents, and m_constituents_mutex.

◆ GetID()

wp_resource_id_t WatchpointResource::GetID ( ) const

Definition at line 44 of file WatchpointResource.cpp.

References m_id.

◆ GetLoadAddress()

addr_t WatchpointResource::GetLoadAddress ( ) const

Definition at line 29 of file WatchpointResource.cpp.

References m_addr.

◆ GetNextID()

wp_resource_id_t WatchpointResource::GetNextID ( )
staticprivate

Definition at line 120 of file WatchpointResource.cpp.

◆ GetNumberOfConstituents()

size_t WatchpointResource::GetNumberOfConstituents ( )

This method returns the number of Watchpoints currently using watchpoint resource.

Returns
The number of constituents.

Definition at line 65 of file WatchpointResource.cpp.

References m_constituents, and m_constituents_mutex.

◆ operator=()

const WatchpointResource & lldb_private::WatchpointResource::operator= ( const WatchpointResource )
privatedelete

◆ RemoveConstituent()

void WatchpointResource::RemoveConstituent ( lldb::WatchpointSP constituent)

The method removes the constituent at constituent from this watchpoint resource.

Definition at line 57 of file WatchpointResource.cpp.

References m_constituents, and m_constituents_mutex.

◆ SetType()

void WatchpointResource::SetType ( bool  read,
bool  write 
)

Definition at line 39 of file WatchpointResource.cpp.

References m_watch_read, and m_watch_write.

◆ ShouldStop()

bool WatchpointResource::ShouldStop ( StoppointCallbackContext context)

Enquires of the atchpoints that produced this watchpoint resource whether we should stop at this location.

Parameters
[in]contextThis contains the information about this stop.
Returns
true if we should stop, false otherwise.

Definition at line 97 of file WatchpointResource.cpp.

References m_constituents, and m_constituents_mutex.

◆ WatchpointResourceRead()

bool WatchpointResource::WatchpointResourceRead ( ) const

Definition at line 33 of file WatchpointResource.cpp.

References m_watch_read.

◆ WatchpointResourceWrite()

bool WatchpointResource::WatchpointResourceWrite ( ) const

Definition at line 35 of file WatchpointResource.cpp.

References m_watch_write.

Friends And Related Function Documentation

◆ StopInfoWatchpoint

friend class StopInfoWatchpoint
friend

Definition at line 132 of file WatchpointResource.h.

Member Data Documentation

◆ m_addr

lldb::addr_t lldb_private::WatchpointResource::m_addr
private

Definition at line 143 of file WatchpointResource.h.

Referenced by Contains(), Dump(), and GetLoadAddress().

◆ m_constituents

WatchpointCollection lldb_private::WatchpointResource::m_constituents
private

◆ m_constituents_mutex

std::mutex lldb_private::WatchpointResource::m_constituents_mutex
private

◆ m_id

lldb::wp_resource_id_t lldb_private::WatchpointResource::m_id
private

Definition at line 139 of file WatchpointResource.h.

Referenced by GetID().

◆ m_size

size_t lldb_private::WatchpointResource::m_size
private

Definition at line 144 of file WatchpointResource.h.

Referenced by Contains(), Dump(), and GetByteSize().

◆ m_watch_read

bool lldb_private::WatchpointResource::m_watch_read
private

Definition at line 146 of file WatchpointResource.h.

Referenced by SetType(), and WatchpointResourceRead().

◆ m_watch_write

bool lldb_private::WatchpointResource::m_watch_write
private

Definition at line 147 of file WatchpointResource.h.

Referenced by SetType(), and WatchpointResourceWrite().


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