Skip to content

Commit 7b7f31d

Browse files
Alexander Yermolovichkusmour
authored andcommitted
[LLDB] Add API to set breakpoint kind.
Summary: Added an API to set breakpoint kind. Can be used by custom JIT. Test Plan: ninja check-lldb Rollback Plan: Reviewers: gclayton, jpporto, #lldb_team Reviewed By: gclayton Differential Revision: https://phabricator.intern.facebook.com/D77634920 Tasks: T227178858
1 parent 9e323a2 commit 7b7f31d

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

lldb/include/lldb/API/SBBreakpoint.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,15 @@ class LLDB_API SBBreakpoint {
154154

155155
SBStructuredData SerializeToStructuredData();
156156

157+
/// Set the "kind" description for a breakpoint. If the breakpoint is hit
158+
/// the stop info will show this "kind" description instead of the
159+
/// breakpoint number. Mostly useful for internal breakpoints, where the
160+
/// breakpoint number doesn't have meaning to the user.
161+
///
162+
/// \param[in] kind
163+
/// New "kind" description.
164+
void SetBreakpointKind(const char *kind);
165+
157166
private:
158167
friend class SBBreakpointList;
159168
friend class SBBreakpointLocation;

lldb/source/API/SBBreakpoint.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,17 @@ bool SBBreakpoint::IsHardware() const {
783783

784784
BreakpointSP SBBreakpoint::GetSP() const { return m_opaque_wp.lock(); }
785785

786+
void SBBreakpoint::SetBreakpointKind(const char *kind) {
787+
LLDB_INSTRUMENT_VA(this);
788+
789+
BreakpointSP bkpt_sp = GetSP();
790+
if (!bkpt_sp)
791+
return;
792+
std::lock_guard<std::recursive_mutex> guard(
793+
bkpt_sp->GetTarget().GetAPIMutex());
794+
bkpt_sp->SetBreakpointKind(kind);
795+
}
796+
786797
// This is simple collection of breakpoint id's and their target.
787798
class SBBreakpointListImpl {
788799
public:

0 commit comments

Comments
 (0)