mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-26 13:26:22 +00:00
Add an SB API to get the SBTarget from an SBBreakpoint
Differential Revision: https://reviews.llvm.org/D89358
This commit is contained in:
parent
a91dd3d37d
commit
6754caa9bf
@ -100,6 +100,9 @@ public:
|
||||
void
|
||||
ClearAllBreakpointSites ();
|
||||
|
||||
lldb::SBTarget
|
||||
GetTarget() const;
|
||||
|
||||
lldb::SBBreakpointLocation
|
||||
FindLocationByAddress (lldb::addr_t vm_addr);
|
||||
|
||||
|
@ -42,6 +42,8 @@ public:
|
||||
|
||||
void ClearAllBreakpointSites();
|
||||
|
||||
lldb::SBTarget GetTarget() const;
|
||||
|
||||
lldb::SBBreakpointLocation FindLocationByAddress(lldb::addr_t vm_addr);
|
||||
|
||||
lldb::break_id_t FindLocationIDByAddress(lldb::addr_t vm_addr);
|
||||
|
@ -81,6 +81,16 @@ bool SBBreakpoint::operator!=(const lldb::SBBreakpoint &rhs) {
|
||||
return m_opaque_wp.lock() != rhs.m_opaque_wp.lock();
|
||||
}
|
||||
|
||||
SBTarget SBBreakpoint::GetTarget() const {
|
||||
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBTarget, SBBreakpoint, GetTarget);
|
||||
|
||||
BreakpointSP bkpt_sp = GetSP();
|
||||
if (bkpt_sp)
|
||||
return LLDB_RECORD_RESULT(SBTarget(bkpt_sp->GetTargetSP()));
|
||||
|
||||
return LLDB_RECORD_RESULT(SBTarget());
|
||||
}
|
||||
|
||||
break_id_t SBBreakpoint::GetID() const {
|
||||
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::break_id_t, SBBreakpoint, GetID);
|
||||
|
||||
@ -987,6 +997,7 @@ void RegisterMethods<SBBreakpoint>(Registry &R) {
|
||||
SBBreakpoint, operator==,(const lldb::SBBreakpoint &));
|
||||
LLDB_REGISTER_METHOD(bool,
|
||||
SBBreakpoint, operator!=,(const lldb::SBBreakpoint &));
|
||||
LLDB_REGISTER_METHOD_CONST(lldb::SBTarget, SBBreakpoint, GetTarget, ());
|
||||
LLDB_REGISTER_METHOD_CONST(lldb::break_id_t, SBBreakpoint, GetID, ());
|
||||
LLDB_REGISTER_METHOD_CONST(bool, SBBreakpoint, IsValid, ());
|
||||
LLDB_REGISTER_METHOD_CONST(bool, SBBreakpoint, operator bool, ());
|
||||
|
@ -66,6 +66,9 @@ class BreakpointAPITestCase(TestBase):
|
||||
location = breakpoint.GetLocationAtIndex(0)
|
||||
self.assertTrue(location.IsValid())
|
||||
|
||||
# Make sure the breakpoint's target is right:
|
||||
self.assertEqual(target, breakpoint.GetTarget(), "Breakpoint reports its target correctly")
|
||||
|
||||
self.assertTrue(self.dbg.DeleteTarget(target))
|
||||
self.assertFalse(breakpoint.IsValid())
|
||||
self.assertFalse(location.IsValid())
|
||||
|
Loading…
x
Reference in New Issue
Block a user