23 : m_owner(owner), m_next_id(0), m_new_location_recorder(nullptr) {}
29 bool resolve_indirect_symbols) {
30 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
48 return bp->ShouldStop(context);
58 return bp_loc_sp->GetID();
64 return lhs->GetID() < val;
69 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
71 collection::const_iterator pos =
73 if (pos != end && (*pos)->GetID() == break_id)
81 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
82 const size_t orig_size = bp_loc_list.
GetSize();
85 for (pos =
m_locations.begin(); pos != end; ++pos) {
87 SectionSP section_sp(break_loc->GetAddress().GetSection());
88 if (section_sp && section_sp->GetModule().get() == module) {
89 bp_loc_list.
Add(break_loc);
92 return bp_loc_list.
GetSize() - orig_size;
97 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
116 bp_loc_sp = pos->second;
123 s->
Printf(
"%p: ",
static_cast<const void *
>(
this));
125 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
126 s->
Printf(
"BreakpointLocationList with %" PRIu64
" BreakpointLocations:\n",
129 collection::const_iterator pos, end =
m_locations.end();
136 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
145 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
154 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
157 (*pos)->ClearBreakpointSite();
161 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
164 for (pos =
m_locations.begin(); pos != end; ++pos) {
165 if ((*pos)->IsEnabled())
166 (*pos)->ResolveBreakpointSite();
171 uint32_t hit_count = 0;
172 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
173 collection::const_iterator pos, end =
m_locations.end();
175 hit_count += (*pos)->GetHitCount();
180 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
182 loc->ResetHitCount();
186 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
187 size_t resolve_count = 0;
188 collection::const_iterator pos, end =
m_locations.end();
189 for (pos =
m_locations.begin(); pos != end; ++pos) {
190 if ((*pos)->IsResolved())
193 return resolve_count;
198 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
201 for (pos =
m_locations.begin(); pos != end; ++pos) {
203 (*pos)->GetDescription(s, level);
208 const Address &addr,
bool resolve_indirect_symbols,
bool *new_location) {
209 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
212 *new_location =
false;
215 bp_loc_sp =
Create(addr, resolve_indirect_symbols);
217 bp_loc_sp->ResolveBreakpointSite();
220 *new_location =
true;
232 if (!from_location_sp || !to_location_sp)
236 to_location_sp->SwapLocation(from_location_sp);
239 to_location_sp->ResolveBreakpointSite();
245 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
250 for (
size_t idx = 0; idx < num_locations; idx++) {
267 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
298 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
304 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
313 if (cur_id > highest_id)
static bool Compare(BreakpointLocationSP lhs, lldb::break_id_t val)
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.
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.
bool ShouldStop(StoppointCallbackContext *context, lldb::break_id_t breakID)
Enquires of the breakpoint location in this list with ID breakID whether we should stop.
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.
General Outline: A breakpoint has four main parts, a filter, a resolver, the list of breakpoint locat...
Target & GetTarget()
Accessor for the breakpoint Target.
A class that describes an executable image and its associated object and symbol files.
bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr, bool allow_section_end=false) const
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.
SectionLoadList & GetSectionLoadList()
#define LLDB_INVALID_BREAK_ID
#define LLDB_INVALID_THREAD_ID
A class that represents a running process on the host machine.
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