Skip to content

Commit 1dfcb05

Browse files
committed
Implement Jonas's review suggestions.
1 parent e207a54 commit 1dfcb05

File tree

5 files changed

+33
-35
lines changed

5 files changed

+33
-35
lines changed

lldb/include/lldb/Breakpoint/BreakpointLocation.h

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -409,38 +409,39 @@ class BreakpointLocation
409409
bool m_should_resolve_indirect_functions;
410410
bool m_is_reexported;
411411
bool m_is_indirect;
412-
Address m_address; ///< The address defining this location.
413-
Breakpoint &m_owner; ///< The breakpoint that produced this object.
414-
std::unique_ptr<BreakpointOptions> m_options_up; ///< Breakpoint options
415-
/// pointer, nullptr if we're
416-
/// using our breakpoint's
417-
/// options.
418-
lldb::BreakpointSiteSP m_bp_site_sp; ///< Our breakpoint site (it may be
419-
///shared by more than one location.)
420-
lldb::UserExpressionSP m_user_expression_sp; ///< The compiled expression to
421-
///use in testing our condition.
422-
std::mutex m_condition_mutex; ///< Guards parsing and evaluation of the
423-
///condition, which could be evaluated by
424-
/// multiple processes.
425-
size_t m_condition_hash; ///< For testing whether the condition source code
426-
///changed.
427-
lldb::break_id_t m_loc_id; ///< Breakpoint location ID.
428-
StoppointHitCounter m_hit_counter; ///< Number of times this breakpoint
429-
/// location has been hit.
412+
///< The address defining this location.
413+
Address m_address;
414+
///< The breakpoint that produced this object.
415+
Breakpoint &m_owner;
416+
///< Breakpoint options pointer, nullptr if we're using our breakpoint's
417+
/// options.
418+
std::unique_ptr<BreakpointOptions> m_options_up;
419+
///< Our breakpoint site (it may be shared by more than one location.)
420+
lldb::BreakpointSiteSP m_bp_site_sp;
421+
///< The compiled expression to use in testing our condition.
422+
lldb::UserExpressionSP m_user_expression_sp;
423+
///< Guards parsing and evaluation of the condition, which could be evaluated
424+
/// by multiple processes.
425+
std::mutex m_condition_mutex;
426+
///< For testing whether the condition source code changed.
427+
size_t m_condition_hash;
428+
///< Breakpoint location ID.
429+
lldb::break_id_t m_loc_id;
430+
///< Number of times this breakpoint location has been hit.
431+
StoppointHitCounter m_hit_counter;
430432
/// If this exists, use it to print the stop description rather than the
431433
/// LineEntry m_address resolves to directly. Use this for instance when the
432434
/// location was given somewhere in the virtual inlined call stack since the
433435
/// Address always resolves to the lowest entry in the stack.
434436
std::optional<LineEntry> m_preferred_line_entry;
435-
bool m_is_valid = true; /// Because Facade locations don't have sites
436-
/// we can't use the presence of the site to mean
437-
/// this breakpoint is valid, but must manage
438-
/// the state directly.
439-
bool m_is_facade = false; /// Facade locations aren't directly triggered
440-
/// and don't have a breakpoint site. They are
441-
/// a useful fiction when you want to represent
442-
/// the stop location as something lldb can't
443-
/// naturally stop at.
437+
/// Because Facade locations don't have sites we can't use the presence of
438+
/// the site to mean this breakpoint is valid, but must manage the state
439+
/// directly.
440+
bool m_is_valid = true;
441+
/// Facade locations aren't directly triggered and don't have a breakpoint
442+
/// site. They are a useful fiction when you want to represent the stop
443+
/// location as something lldb can't naturally stop at.
444+
bool m_is_facade = false;
444445

445446
void SetInvalid() { m_is_valid = false; }
446447

lldb/source/API/SBBreakpoint.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,9 +569,9 @@ SBError SBBreakpoint::AddLocation(SBAddress &address) {
569569

570570
SBBreakpointLocation SBBreakpoint::AddFacadeLocation() {
571571
BreakpointSP bkpt_sp = GetSP();
572-
if (!bkpt_sp) {
572+
if (!bkpt_sp)
573573
return {};
574-
}
574+
575575
BreakpointLocationSP loc_sp = bkpt_sp->AddFacadeLocation();
576576
return SBBreakpointLocation(loc_sp);
577577
}

lldb/source/Breakpoint/BreakpointLocation.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,7 @@ llvm::Error BreakpointLocation::ClearBreakpointSite() {
529529
// This might be a Facade Location, which don't have sites or addresses
530530
if (IsFacade())
531531
return llvm::Error::success();
532-
else
533-
return llvm::createStringError("no breakpoint site to clear");
532+
return llvm::createStringError("no breakpoint site to clear");
534533
}
535534

536535
// If the process exists, get it to remove the owner, it will remove the
@@ -692,7 +691,7 @@ void BreakpointLocation::GetDescription(Stream *s,
692691
}
693692
}
694693

695-
// Scripted breakpoint are currently always resolved. Does this seem right?
694+
// FIXME: scripted breakpoint are currently always resolved. Does this seem right?
696695
// If they don't add any scripted locations, we shouldn't consider them
697696
// resolved.
698697
bool is_resolved = is_scripted_desc || IsResolved();

lldb/source/Breakpoint/BreakpointResolverScripted.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ BreakpointResolverScripted::WasHit(lldb::StackFrameSP frame_sp,
173173
lldb::BreakpointLocationSP bp_loc_sp) {
174174
if (m_interface_sp)
175175
return m_interface_sp->WasHit(frame_sp, bp_loc_sp);
176-
177176
return {};
178177
}
179178

lldb/source/Interpreter/ScriptInterpreter.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,8 @@ ScriptInterpreter::GetStatusFromSBError(const lldb::SBError &error) const {
108108

109109
lldb::StackFrameSP
110110
ScriptInterpreter::GetOpaqueTypeFromSBFrame(const lldb::SBFrame &frame) const {
111-
if (frame.m_opaque_sp) {
111+
if (frame.m_opaque_sp)
112112
return frame.m_opaque_sp->GetFrameSP();
113-
}
114113
return nullptr;
115114
}
116115

0 commit comments

Comments
 (0)