1919
2020using namespace lldb_dap ;
2121
22- void Breakpoint::SetCondition () { bp .SetCondition (condition .c_str ()); }
22+ void Breakpoint::SetCondition () { m_bp .SetCondition (m_condition .c_str ()); }
2323
2424void Breakpoint::SetHitCondition () {
2525 uint64_t hitCount = 0 ;
26- if (llvm::to_integer (hitCondition , hitCount))
27- bp .SetIgnoreCount (hitCount - 1 );
26+ if (llvm::to_integer (m_hit_condition , hitCount))
27+ m_bp .SetIgnoreCount (hitCount - 1 );
2828}
2929
3030void Breakpoint::CreateJsonObject (llvm::json::Object &object) {
3131 // Each breakpoint location is treated as a separate breakpoint for VS code.
3232 // They don't have the notion of a single breakpoint with multiple locations.
33- if (!bp .IsValid ())
33+ if (!m_bp .IsValid ())
3434 return ;
35- object.try_emplace (" verified" , bp .GetNumResolvedLocations () > 0 );
36- object.try_emplace (" id" , bp .GetID ());
35+ object.try_emplace (" verified" , m_bp .GetNumResolvedLocations () > 0 );
36+ object.try_emplace (" id" , m_bp .GetID ());
3737 // VS Code DAP doesn't currently allow one breakpoint to have multiple
3838 // locations so we just report the first one. If we report all locations
3939 // then the IDE starts showing the wrong line numbers and locations for
@@ -43,20 +43,20 @@ void Breakpoint::CreateJsonObject(llvm::json::Object &object) {
4343 // this as the breakpoint location since it will have a complete location
4444 // that is at least loaded in the current process.
4545 lldb::SBBreakpointLocation bp_loc;
46- const auto num_locs = bp .GetNumLocations ();
46+ const auto num_locs = m_bp .GetNumLocations ();
4747 for (size_t i = 0 ; i < num_locs; ++i) {
48- bp_loc = bp .GetLocationAtIndex (i);
48+ bp_loc = m_bp .GetLocationAtIndex (i);
4949 if (bp_loc.IsResolved ())
5050 break ;
5151 }
5252 // If not locations are resolved, use the first location.
5353 if (!bp_loc.IsResolved ())
54- bp_loc = bp .GetLocationAtIndex (0 );
54+ bp_loc = m_bp .GetLocationAtIndex (0 );
5555 auto bp_addr = bp_loc.GetAddress ();
5656
5757 if (bp_addr.IsValid ()) {
5858 std::string formatted_addr =
59- " 0x" + llvm::utohexstr (bp_addr.GetLoadAddress (bp .GetTarget ()));
59+ " 0x" + llvm::utohexstr (bp_addr.GetLoadAddress (m_bp .GetTarget ()));
6060 object.try_emplace (" instructionReference" , formatted_addr);
6161 auto line_entry = bp_addr.GetLineEntry ();
6262 const auto line = line_entry.GetLine ();
@@ -69,12 +69,14 @@ void Breakpoint::CreateJsonObject(llvm::json::Object &object) {
6969 }
7070}
7171
72- bool Breakpoint::MatchesName (const char *name) { return bp.MatchesName (name); }
72+ bool Breakpoint::MatchesName (const char *name) {
73+ return m_bp.MatchesName (name);
74+ }
7375
7476void Breakpoint::SetBreakpoint () {
75- bp .AddName (kDAPBreakpointLabel );
76- if (!condition .empty ())
77+ m_bp .AddName (kDAPBreakpointLabel );
78+ if (!m_condition .empty ())
7779 SetCondition ();
78- if (!hitCondition .empty ())
80+ if (!m_hit_condition .empty ())
7981 SetHitCondition ();
8082}
0 commit comments