mirror of
https://github.com/intel/llvm.git
synced 2026-01-19 17:45:07 +08:00
Add SBTarget::GetLastCreatedWatchpointLocation() API and export to the Python interface.
Also add rich comparison methods (__eq__ and __ne__) for SBWatchpointLocation. Modify TestWatchpointLocationIter.py to exercise the new APIs. Add fuzz testings for the recently added SBTarget APIs related to watchpoint manipulations. llvm-svn: 140633
This commit is contained in:
@@ -871,19 +871,40 @@ SBTarget::GetNumWatchpointLocations () const
|
||||
{
|
||||
if (m_opaque_sp)
|
||||
{
|
||||
// The breakpoint list is thread safe, no need to lock
|
||||
// The watchpoint location list is thread safe, no need to lock
|
||||
return m_opaque_sp->GetWatchpointLocationList().GetSize();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
SBWatchpointLocation
|
||||
SBTarget::GetLastCreatedWatchpointLocation ()
|
||||
{
|
||||
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
|
||||
|
||||
SBWatchpointLocation sb_watchpoint_location;
|
||||
if (m_opaque_sp)
|
||||
{
|
||||
Mutex::Locker api_locker (m_opaque_sp->GetAPIMutex());
|
||||
sb_watchpoint_location = m_opaque_sp->GetLastCreatedWatchpointLocation();
|
||||
}
|
||||
|
||||
if (log)
|
||||
{
|
||||
log->Printf ("SBTarget(%p)::GetLastCreateWatchpointLocation () => SBWatchpointLocation(%p)",
|
||||
m_opaque_sp.get(), sb_watchpoint_location.get());
|
||||
}
|
||||
|
||||
return sb_watchpoint_location;
|
||||
}
|
||||
|
||||
SBWatchpointLocation
|
||||
SBTarget::GetWatchpointLocationAtIndex (uint32_t idx) const
|
||||
{
|
||||
SBWatchpointLocation sb_watchpoint_location;
|
||||
if (m_opaque_sp)
|
||||
{
|
||||
// The breakpoint list is thread safe, no need to lock
|
||||
// The watchpoint location list is thread safe, no need to lock
|
||||
*sb_watchpoint_location = m_opaque_sp->GetWatchpointLocationList().GetByIndex(idx);
|
||||
}
|
||||
return sb_watchpoint_location;
|
||||
|
||||
Reference in New Issue
Block a user