31 bool resolve_indirect_symbols) {
32 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
37 resolve_indirect_symbols));
51 return bp->ShouldStop(context, bp_loc_sp);
61 return bp_loc_sp->GetID();
67 return lhs->GetID() < val;
72 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
74 collection::const_iterator pos =
76 if (pos != end && (*pos)->GetID() == break_id)
83 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
84 const size_t orig_size = bp_loc_list.
GetSize();
87 for (pos =
m_locations.begin(); pos != end; ++pos) {
89 SectionSP section_sp(break_loc->GetAddress().GetSection());
90 if (section_sp && section_sp->GetModule().get() == module) {
91 bp_loc_list.
Add(break_loc);
94 return bp_loc_list.
GetSize() - orig_size;
99 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
117 bp_loc_sp = pos->second;
124 s->
Printf(
"%p: ",
static_cast<const void *
>(
this));
126 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
127 s->
Printf(
"BreakpointLocationList with %" PRIu64
" BreakpointLocations:\n",
130 collection::const_iterator pos, end =
m_locations.end();
137 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
146 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
155 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
159 for (pos =
m_locations.begin(); pos != end; ++pos) {
160 if (llvm::Error
error = (*pos)->ClearBreakpointSite())
166 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
170 for (pos =
m_locations.begin(); pos != end; ++pos) {
171 if ((*pos)->IsEnabled()) {
172 if (llvm::Error
error = (*pos)->ResolveBreakpointSite())
179 uint32_t hit_count = 0;
180 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
181 collection::const_iterator pos, end =
m_locations.end();
183 hit_count += (*pos)->GetHitCount();
188 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
190 loc->ResetHitCount();
194 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
195 size_t resolve_count = 0;
196 collection::const_iterator pos, end =
m_locations.end();
197 for (pos =
m_locations.begin(); pos != end; ++pos) {
198 if ((*pos)->IsResolved())
201 return resolve_count;
206 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
209 for (pos =
m_locations.begin(); pos != end; ++pos) {
211 (*pos)->GetDescription(s, level);
216 const Address &addr,
bool resolve_indirect_symbols,
bool *new_location) {
217 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
220 *new_location =
false;
223 bp_loc_sp =
Create(addr, resolve_indirect_symbols);
225 if (llvm::Error
error = bp_loc_sp->ResolveBreakpointSite())
229 *new_location =
true;
241 if (!from_location_sp || !to_location_sp)
245 to_location_sp->SwapLocation(from_location_sp);
248 llvm::consumeError(to_location_sp->ResolveBreakpointSite());
254 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
259 for (
size_t idx = 0; idx < num_locations; idx++) {
276 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
307 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
313 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
322 if (cur_id > highest_id)
static bool Compare(BreakpointLocationSP lhs, lldb::break_id_t val)
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOG_ERROR(log, error,...)
A section + offset based address class.
bool SectionWasDeleted() const
lldb::ModuleSP GetModule() const
Get accessor for the module for this address.
lldb::addr_t GetOffset() const
Get the section relative offset value.
bool IsValid() const
Check if the object state is valid.
bool IsSectionOffset() const
Check if an address is section offset.
An architecture specification class.
bool IsValid() const
Tests if this ArchSpec is valid.
bool IsCompatibleMatch(const ArchSpec &rhs) const
Shorthand for IsMatch(rhs, CompatibleMatch).
void Add(const lldb::BreakpointLocationSP &bp_loc_sp)
Add the breakpoint bp_loc_sp to the list.
size_t GetSize() const
Returns the number of elements in this breakpoint location list.
void ResetHitCount()
Resets the hit count of all locations in this list.
void GetDescription(Stream *s, lldb::DescriptionLevel level)
Print a description of the breakpoint locations in this list to the stream s.
void RemoveInvalidLocations(const ArchSpec &arch)
lldb::BreakpointLocationSP GetByIndex(size_t i)
Returns a shared pointer to the breakpoint location with index i.
bool RemoveLocation(const lldb::BreakpointLocationSP &bp_loc_sp)
void Dump(Stream *s) const
Standard "Dump" method. At present it does nothing.
void ClearAllBreakpointSites()
Removes all the locations in this list from their breakpoint site owners list.
uint32_t GetHitCount() const
Returns the number hit count of all locations in this list.
bool ShouldStop(StoppointCallbackContext *context, lldb::break_id_t breakID, lldb::BreakpointLocationSP &bp_loc_sp)
Enquires of the breakpoint location in this list with ID breakID whether we should stop.
const lldb::BreakpointLocationSP FindByAddress(const Address &addr) const
Returns a shared pointer to the breakpoint location at address addr - const version.
addr_map m_address_to_location
void ResolveAllBreakpointSites()
Tells all the breakpoint locations in this list to attempt to resolve any possible breakpoint sites.
size_t FindInModule(Module *module, BreakpointLocationCollection &bp_loc_list)
Returns a breakpoint location list of the breakpoint locations in the module module.
BreakpointLocationList(Breakpoint &owner)
This is the standard constructor.
lldb::break_id_t m_next_id
BreakpointLocationCollection * m_new_location_recorder
lldb::BreakpointLocationSP FindByID(lldb::break_id_t breakID) const
Returns a shared pointer to the breakpoint location with id breakID, const version.
void RemoveLocationByIndex(size_t idx)
lldb::BreakpointLocationSP Create(const Address &addr, bool resolve_indirect_symbols)
lldb::BreakpointLocationSP AddLocation(const Address &addr, bool resolve_indirect_symbols, bool *new_location=nullptr)
void StartRecordingNewLocations(BreakpointLocationCollection &new_locations)
void StopRecordingNewLocations()
lldb::break_id_t FindIDByAddress(const Address &addr)
Returns the breakpoint location id to the breakpoint location at address addr.
size_t GetNumResolvedLocations() const
Returns the number of breakpoint locations in this list with resolved breakpoints.
std::recursive_mutex m_mutex
void SwapLocation(lldb::BreakpointLocationSP to_location_sp, lldb::BreakpointLocationSP from_location_sp)
virtual ~BreakpointLocationList()
General Outline: A breakpoint location is defined by the breakpoint that produces it,...
Address & GetAddress()
Gets the Address for this breakpoint location.
A class that describes an executable image and its associated object and symbol files.
General Outline: When we hit a breakpoint we need to package up whatever information is needed to eva...
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
void IndentLess(unsigned amount=2)
Decrement the current indentation level.
void IndentMore(unsigned amount=2)
Increment the current indentation level.
#define LLDB_INVALID_BREAK_ID
#define LLDB_INVALID_THREAD_ID
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
std::shared_ptr< lldb_private::BreakpointLocation > BreakpointLocationSP
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
std::shared_ptr< lldb_private::Section > SectionSP
std::shared_ptr< lldb_private::Module > ModuleSP