diff options
author | Greg Clayton <gclayton@apple.com> | 2010-07-09 20:39:50 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2010-07-09 20:39:50 +0000 |
commit | c982c768d248b21b82fbd70b61a4cc824cd82ddc (patch) | |
tree | 68c5d417ce51994a2d393e5a5a7f0025b6e4ed35 /lldb/source/Breakpoint | |
parent | 2a5725b1a324639d0e16e9c125f5713acfabca60 (diff) | |
download | bcm5719-llvm-c982c768d248b21b82fbd70b61a4cc824cd82ddc.tar.gz bcm5719-llvm-c982c768d248b21b82fbd70b61a4cc824cd82ddc.zip |
Merged Eli Friedman's linux build changes where he added Makefile files that
enabled LLVM make style building and made this compile LLDB on Mac OS X. We
can now iterate on this to make the build work on both linux and macosx.
llvm-svn: 108009
Diffstat (limited to 'lldb/source/Breakpoint')
-rw-r--r-- | lldb/source/Breakpoint/Breakpoint.cpp | 29 | ||||
-rw-r--r-- | lldb/source/Breakpoint/BreakpointIDList.cpp | 72 | ||||
-rw-r--r-- | lldb/source/Breakpoint/BreakpointLocation.cpp | 4 | ||||
-rw-r--r-- | lldb/source/Breakpoint/BreakpointLocationCollection.cpp | 23 | ||||
-rw-r--r-- | lldb/source/Breakpoint/BreakpointLocationList.cpp | 31 | ||||
-rw-r--r-- | lldb/source/Breakpoint/BreakpointOptions.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Breakpoint/BreakpointResolverFileLine.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Breakpoint/BreakpointSite.cpp | 8 | ||||
-rw-r--r-- | lldb/source/Breakpoint/BreakpointSiteList.cpp | 22 | ||||
-rw-r--r-- | lldb/source/Breakpoint/Makefile | 14 | ||||
-rw-r--r-- | lldb/source/Breakpoint/StoppointLocation.cpp | 12 | ||||
-rw-r--r-- | lldb/source/Breakpoint/WatchpointLocation.cpp | 4 |
12 files changed, 112 insertions, 115 deletions
diff --git a/lldb/source/Breakpoint/Breakpoint.cpp b/lldb/source/Breakpoint/Breakpoint.cpp index 12dceac7476..e11604ba22e 100644 --- a/lldb/source/Breakpoint/Breakpoint.cpp +++ b/lldb/source/Breakpoint/Breakpoint.cpp @@ -153,12 +153,12 @@ Breakpoint::IsEnabled () } void -Breakpoint::SetIgnoreCount (int32_t n) +Breakpoint::SetIgnoreCount (uint32_t n) { m_options.SetIgnoreCount(n); } -int32_t +uint32_t Breakpoint::GetIgnoreCount () const { return m_options.GetIgnoreCount(); @@ -255,7 +255,7 @@ Breakpoint::ModulesChanged (ModuleList &module_list, bool load) // them after the locations pass. Have to do it this way because // resolving breakpoints will add new locations potentially. - for (int i = 0; i < module_list.GetSize(); i++) + for (size_t i = 0; i < module_list.GetSize(); i++) { bool seen = false; ModuleSP module_sp (module_list.GetModuleAtIndex (i)); @@ -263,9 +263,9 @@ Breakpoint::ModulesChanged (ModuleList &module_list, bool load) if (!m_filter_sp->ModulePasses (module_sp)) continue; - for (int i = 0; i < m_locations.GetSize(); i++) + for (size_t j = 0; j < m_locations.GetSize(); j++) { - BreakpointLocationSP break_loc = m_locations.GetByIndex(i); + BreakpointLocationSP break_loc = m_locations.GetByIndex(j); const Section *section = break_loc->GetAddress().GetSection(); if (section == NULL || section->GetModule() == module) { @@ -300,15 +300,15 @@ Breakpoint::ModulesChanged (ModuleList &module_list, bool load) // the same? Or do we need to do an equality on modules that is an // "equivalence"??? - for (int i = 0; i < module_list.GetSize(); i++) + for (size_t i = 0; i < module_list.GetSize(); i++) { ModuleSP module_sp (module_list.GetModuleAtIndex (i)); if (!m_filter_sp->ModulePasses (module_sp)) continue; - for (int i = 0; i < m_locations.GetSize(); i++) + for (size_t j = 0; j < m_locations.GetSize(); j++) { - BreakpointLocationSP break_loc = m_locations.GetByIndex(i); + BreakpointLocationSP break_loc = m_locations.GetByIndex(j); const Section *section = break_loc->GetAddress().GetSection(); if (section) { @@ -353,8 +353,8 @@ Breakpoint::GetDescription (Stream *s, lldb::DescriptionLevel level, bool show_l GetResolverDescription (s); GetFilterDescription (s); - const uint32_t num_locations = GetNumLocations (); - const uint32_t num_resolved_locations = GetNumResolvedLocations (); + const size_t num_locations = GetNumLocations (); + const size_t num_resolved_locations = GetNumResolvedLocations (); switch (level) { @@ -362,9 +362,9 @@ Breakpoint::GetDescription (Stream *s, lldb::DescriptionLevel level, bool show_l case lldb::eDescriptionLevelFull: if (num_locations > 0) { - s->Printf(", locations = %u", num_locations); + s->Printf(", locations = %zu", num_locations); if (num_resolved_locations > 0) - s->Printf(", resolved = %u", num_resolved_locations); + s->Printf(", resolved = %zu", num_resolved_locations); } else { @@ -387,12 +387,15 @@ Breakpoint::GetDescription (Stream *s, lldb::DescriptionLevel level, bool show_l s->Indent(); GetOptions()->GetDescription(s, level); break; + + default: + break; } if (show_locations) { s->IndentMore(); - for (int i = 0; i < GetNumLocations(); ++i) + for (size_t i = 0; i < num_locations; ++i) { BreakpointLocation *loc = GetLocationAtIndex(i).get(); loc->GetDescription(s, level); diff --git a/lldb/source/Breakpoint/BreakpointIDList.cpp b/lldb/source/Breakpoint/BreakpointIDList.cpp index 998afbf6ccb..949bbbed74e 100644 --- a/lldb/source/Breakpoint/BreakpointIDList.cpp +++ b/lldb/source/Breakpoint/BreakpointIDList.cpp @@ -31,14 +31,14 @@ BreakpointIDList::~BreakpointIDList () { } -int -BreakpointIDList::Size() +size_t +BreakpointIDList::GetSize() { return m_breakpoint_ids.size(); } BreakpointID & -BreakpointIDList::GetBreakpointIDAtIndex (int index) +BreakpointIDList::GetBreakpointIDAtIndex (uint32_t index) { if (index < m_breakpoint_ids.size()) return m_breakpoint_ids[index]; @@ -47,23 +47,13 @@ BreakpointIDList::GetBreakpointIDAtIndex (int index) } bool -BreakpointIDList::RemoveBreakpointIDAtIndex (int index) +BreakpointIDList::RemoveBreakpointIDAtIndex (uint32_t index) { - bool success = false; - if (index < m_breakpoint_ids.size()) - { - BreakpointIDArray::iterator pos; - int i; + if (index >= m_breakpoint_ids.size()) + return false; - for (pos = m_breakpoint_ids.begin(), i = 0; i != index && pos != m_breakpoint_ids.end(); ++pos, ++i); - assert (i == index); - if (pos != m_breakpoint_ids.end()) - { - m_breakpoint_ids.erase (pos); - success = true; - } - } - return success; + m_breakpoint_ids.erase (m_breakpoint_ids.begin() + index); + return true; } void @@ -99,12 +89,12 @@ BreakpointIDList::AddBreakpointID (const char *bp_id_str) } bool -BreakpointIDList::FindBreakpointID (BreakpointID &bp_id, int *position) +BreakpointIDList::FindBreakpointID (BreakpointID &bp_id, uint32_t *position) { bool success = false; BreakpointIDArray::iterator tmp_pos; - for (int i = 0; i < m_breakpoint_ids.size(); ++i) + for (size_t i = 0; i < m_breakpoint_ids.size(); ++i) { BreakpointID tmp_id = m_breakpoint_ids[i]; if (tmp_id.GetBreakpointID() == bp_id.GetBreakpointID() @@ -120,7 +110,7 @@ BreakpointIDList::FindBreakpointID (BreakpointID &bp_id, int *position) } bool -BreakpointIDList::FindBreakpointID (const char *bp_id_str, int *position) +BreakpointIDList::FindBreakpointID (const char *bp_id_str, uint32_t *position) { BreakpointID temp_bp_id; break_id_t bp_id; @@ -136,12 +126,12 @@ BreakpointIDList::FindBreakpointID (const char *bp_id_str, int *position) } void -BreakpointIDList::InsertStringArray (const char **string_array, int array_size, CommandReturnObject &result) +BreakpointIDList::InsertStringArray (const char **string_array, uint32_t array_size, CommandReturnObject &result) { if (string_array == NULL) return; - for (int i = 0; i < array_size; ++i) + for (uint32_t i = 0; i < array_size; ++i) { break_id_t bp_id; break_id_t loc_id; @@ -176,24 +166,23 @@ void BreakpointIDList::FindAndReplaceIDRanges (Args &old_args, Target *target, CommandReturnObject &result, Args &new_args) { - char *range_start; + std::string range_start; const char *range_end; const char *current_arg; - int num_old_args = old_args.GetArgumentCount(); + const size_t num_old_args = old_args.GetArgumentCount(); - for (int i = 0; i < num_old_args; ++i) + for (size_t i = 0; i < num_old_args; ++i) { bool is_range = false; current_arg = old_args.GetArgumentAtIndex (i); - int range_start_len = 0; - int range_end_pos = 0; + uint32_t range_start_len = 0; + uint32_t range_end_pos = 0; if (BreakpointIDList::StringContainsIDRangeExpression (current_arg, &range_start_len, &range_end_pos)) { is_range = true; range_start = (char *) malloc (range_start_len + 1); - strncpy (range_start, current_arg, range_start_len); - range_start[range_start_len] = '\0'; + range_start.assign (current_arg, range_start_len); range_end = current_arg + range_end_pos; } else if ((i + 2 < num_old_args) @@ -201,7 +190,7 @@ BreakpointIDList::FindAndReplaceIDRanges (Args &old_args, Target *target, Comman && BreakpointID::IsValidIDExpression (current_arg) && BreakpointID::IsValidIDExpression (old_args.GetArgumentAtIndex (i+2))) { - range_start = (char *) current_arg; + range_start.assign (current_arg); range_end = old_args.GetArgumentAtIndex (i+2); is_range = true; i = i+2; @@ -214,14 +203,14 @@ BreakpointIDList::FindAndReplaceIDRanges (Args &old_args, Target *target, Comman break_id_t start_loc_id; break_id_t end_loc_id; - BreakpointID::ParseCanonicalReference (range_start, &start_bp_id, &start_loc_id); + BreakpointID::ParseCanonicalReference (range_start.c_str(), &start_bp_id, &start_loc_id); BreakpointID::ParseCanonicalReference (range_end, &end_bp_id, &end_loc_id); if ((start_bp_id == LLDB_INVALID_BREAK_ID) || (! target->GetBreakpointByID (start_bp_id))) { new_args.Clear(); - result.AppendErrorWithFormat ("'%s' is not a valid breakpoint ID.\n", range_start); + result.AppendErrorWithFormat ("'%s' is not a valid breakpoint ID.\n", range_start.c_str()); result.SetStatus (eReturnStatusFailed); return; } @@ -239,8 +228,8 @@ BreakpointIDList::FindAndReplaceIDRanges (Args &old_args, Target *target, Comman // target and find all the breakpoints that fit into this range, and add them to new_args. const BreakpointList& breakpoints = target->GetBreakpointList(); - size_t num_breakpoints = breakpoints.GetSize(); - for (int j = 0; j < num_breakpoints; ++j) + const size_t num_breakpoints = breakpoints.GetSize(); + for (size_t j = 0; j < num_breakpoints; ++j) { Breakpoint *breakpoint = breakpoints.GetBreakpointByIndex (j).get(); break_id_t cur_bp_id = breakpoint->GetID(); @@ -248,11 +237,11 @@ BreakpointIDList::FindAndReplaceIDRanges (Args &old_args, Target *target, Comman if ((cur_bp_id < start_bp_id) || (cur_bp_id > end_bp_id)) continue; - size_t num_locations = breakpoint->GetNumLocations(); + const size_t num_locations = breakpoint->GetNumLocations(); if ((cur_bp_id == start_bp_id) && (start_loc_id != LLDB_INVALID_BREAK_ID)) { - for (int k = 0; k < num_locations; ++k) + for (size_t k = 0; k < num_locations; ++k) { BreakpointLocation * bp_loc = breakpoint->GetLocationAtIndex(k).get(); if (bp_loc->GetID() >= start_loc_id) @@ -265,7 +254,7 @@ BreakpointIDList::FindAndReplaceIDRanges (Args &old_args, Target *target, Comman } else if ((cur_bp_id == end_bp_id) && (end_loc_id != LLDB_INVALID_BREAK_ID)) { - for (int k = 0; k < num_locations; ++k) + for (size_t k = 0; k < num_locations; ++k) { BreakpointLocation * bp_loc = breakpoint->GetLocationAtIndex(k).get(); if (bp_loc->GetID() <= end_loc_id) @@ -294,19 +283,14 @@ BreakpointIDList::FindAndReplaceIDRanges (Args &old_args, Target *target, Comman return; } -//bool -//BreakpointIDList::StringContainsIDRangeExpression (const char *in_string, const char **range_start, -// const **range_end) bool -BreakpointIDList::StringContainsIDRangeExpression (const char *in_string, int *range_start_len, int *range_end_pos) +BreakpointIDList::StringContainsIDRangeExpression (const char *in_string, uint32_t *range_start_len, uint32_t *range_end_pos) { bool is_range_expression = false; std::string arg_str = in_string; std::string::size_type idx; std::string::size_type start_pos = 0; - //*range_start = NULL; - //*range_end = NULL; *range_start_len = 0; *range_end_pos = 0; diff --git a/lldb/source/Breakpoint/BreakpointLocation.cpp b/lldb/source/Breakpoint/BreakpointLocation.cpp index dfaa4eba252..46ed6dcebe1 100644 --- a/lldb/source/Breakpoint/BreakpointLocation.cpp +++ b/lldb/source/Breakpoint/BreakpointLocation.cpp @@ -137,14 +137,14 @@ BreakpointLocation::ClearCallback () GetLocationOptions()->ClearCallback(); } -int32_t +uint32_t BreakpointLocation::GetIgnoreCount () { return GetOptionsNoCreate()->GetIgnoreCount(); } void -BreakpointLocation::SetIgnoreCount (int32_t n) +BreakpointLocation::SetIgnoreCount (uint32_t n) { GetLocationOptions()->SetIgnoreCount(n); } diff --git a/lldb/source/Breakpoint/BreakpointLocationCollection.cpp b/lldb/source/Breakpoint/BreakpointLocationCollection.cpp index 464d38f1d78..af3f8e54be7 100644 --- a/lldb/source/Breakpoint/BreakpointLocationCollection.cpp +++ b/lldb/source/Breakpoint/BreakpointLocationCollection.cpp @@ -46,7 +46,7 @@ BreakpointLocationCollection::Add(const BreakpointLocationSP &bp_loc) } bool -BreakpointLocationCollection::Remove (lldb::user_id_t bp_id, lldb::user_id_t bp_loc_id) +BreakpointLocationCollection::Remove (lldb::break_id_t bp_id, lldb::break_id_t bp_loc_id) { collection::iterator pos = GetIDPairIterator(bp_id, bp_loc_id); // Predicate if (pos != m_break_loc_collection.end()) @@ -61,7 +61,7 @@ BreakpointLocationCollection::Remove (lldb::user_id_t bp_id, lldb::user_id_t bp_ class BreakpointIDPairMatches { public: - BreakpointIDPairMatches (lldb::user_id_t break_id, lldb::user_id_t break_loc_id) : + BreakpointIDPairMatches (lldb::break_id_t break_id, lldb::break_id_t break_loc_id) : m_break_id(break_id), m_break_loc_id (break_loc_id) { @@ -74,26 +74,26 @@ public: } private: - const lldb::user_id_t m_break_id; - const lldb::user_id_t m_break_loc_id; + const lldb::break_id_t m_break_id; + const lldb::break_id_t m_break_loc_id; }; BreakpointLocationCollection::collection::iterator -BreakpointLocationCollection::GetIDPairIterator (lldb::user_id_t break_id, lldb::user_id_t break_loc_id) +BreakpointLocationCollection::GetIDPairIterator (lldb::break_id_t break_id, lldb::break_id_t break_loc_id) { return std::find_if(m_break_loc_collection.begin(), m_break_loc_collection.end(), // Search full range BreakpointIDPairMatches(break_id, break_loc_id)); // Predicate } BreakpointLocationCollection::collection::const_iterator -BreakpointLocationCollection::GetIDPairConstIterator (lldb::user_id_t break_id, lldb::user_id_t break_loc_id) const +BreakpointLocationCollection::GetIDPairConstIterator (lldb::break_id_t break_id, lldb::break_id_t break_loc_id) const { return std::find_if(m_break_loc_collection.begin(), m_break_loc_collection.end(), // Search full range BreakpointIDPairMatches(break_id, break_loc_id)); // Predicate } BreakpointLocationSP -BreakpointLocationCollection::FindByIDPair (lldb::user_id_t break_id, lldb::user_id_t break_loc_id) +BreakpointLocationCollection::FindByIDPair (lldb::break_id_t break_id, lldb::break_id_t break_loc_id) { BreakpointLocationSP stop_sp; collection::iterator pos = GetIDPairIterator(break_id, break_loc_id); @@ -104,7 +104,7 @@ BreakpointLocationCollection::FindByIDPair (lldb::user_id_t break_id, lldb::user } const BreakpointLocationSP -BreakpointLocationCollection::FindByIDPair (lldb::user_id_t break_id, lldb::user_id_t break_loc_id) const +BreakpointLocationCollection::FindByIDPair (lldb::break_id_t break_id, lldb::break_id_t break_loc_id) const { BreakpointLocationSP stop_sp; collection::const_iterator pos = GetIDPairConstIterator(break_id, break_loc_id); @@ -118,7 +118,7 @@ BreakpointLocationSP BreakpointLocationCollection::GetByIndex (uint32_t i) { BreakpointLocationSP stop_sp; - if (i >= 0 && i < m_break_loc_collection.size()) + if (i < m_break_loc_collection.size()) stop_sp = m_break_loc_collection[i]; return stop_sp; @@ -128,7 +128,7 @@ const BreakpointLocationSP BreakpointLocationCollection::GetByIndex (uint32_t i) const { BreakpointLocationSP stop_sp; - if (i >= 0 && i < m_break_loc_collection.size()) + if (i < m_break_loc_collection.size()) stop_sp = m_break_loc_collection[i]; return stop_sp; @@ -139,7 +139,8 @@ BreakpointLocationCollection::ShouldStop (StoppointCallbackContext *context) { bool shouldStop = false; - for (int i = 0; i < GetSize(); i++) { + const size_t count = GetSize(); + for (size_t i = 0; i < count; i++) { bool one_result = GetByIndex(i)->ShouldStop(context); if (one_result) shouldStop = true; diff --git a/lldb/source/Breakpoint/BreakpointLocationList.cpp b/lldb/source/Breakpoint/BreakpointLocationList.cpp index d86a8cf4c47..6a6ac50cb60 100644 --- a/lldb/source/Breakpoint/BreakpointLocationList.cpp +++ b/lldb/source/Breakpoint/BreakpointLocationList.cpp @@ -32,7 +32,7 @@ BreakpointLocationList::~BreakpointLocationList() { } -lldb::user_id_t +lldb::break_id_t BreakpointLocationList::Add (BreakpointLocationSP &bp_loc_sp) { if (bp_loc_sp) @@ -46,7 +46,7 @@ BreakpointLocationList::Add (BreakpointLocationSP &bp_loc_sp) } bool -BreakpointLocationList::ShouldStop (StoppointCallbackContext *context, lldb::user_id_t break_id) +BreakpointLocationList::ShouldStop (StoppointCallbackContext *context, lldb::break_id_t break_id) { BreakpointLocationSP bp = FindByID (break_id); if (bp) @@ -61,7 +61,7 @@ BreakpointLocationList::ShouldStop (StoppointCallbackContext *context, lldb::use return true; } -lldb::user_id_t +lldb::break_id_t BreakpointLocationList::FindIDByAddress (Address &addr) { BreakpointLocationSP bp_loc_sp = FindByAddress (addr); @@ -73,7 +73,7 @@ BreakpointLocationList::FindIDByAddress (Address &addr) } bool -BreakpointLocationList::Remove (lldb::user_id_t break_id) +BreakpointLocationList::Remove (lldb::break_id_t break_id) { Mutex::Locker locker (m_mutex); collection::iterator pos = GetIDIterator(break_id); // Predicate @@ -90,7 +90,7 @@ BreakpointLocationList::Remove (lldb::user_id_t break_id) class BreakpointLocationIDMatches { public: - BreakpointLocationIDMatches (lldb::user_id_t break_id) : + BreakpointLocationIDMatches (lldb::break_id_t break_id) : m_break_id(break_id) { } @@ -101,7 +101,7 @@ public: } private: - const lldb::user_id_t m_break_id; + const lldb::break_id_t m_break_id; }; class BreakpointLocationAddressMatches @@ -122,7 +122,7 @@ private: }; BreakpointLocationList::collection::iterator -BreakpointLocationList::GetIDIterator (lldb::user_id_t break_id) +BreakpointLocationList::GetIDIterator (lldb::break_id_t break_id) { Mutex::Locker locker (m_mutex); return std::find_if (m_locations.begin(), @@ -131,7 +131,7 @@ BreakpointLocationList::GetIDIterator (lldb::user_id_t break_id) } BreakpointLocationList::collection::const_iterator -BreakpointLocationList::GetIDConstIterator (lldb::user_id_t break_id) const +BreakpointLocationList::GetIDConstIterator (lldb::break_id_t break_id) const { Mutex::Locker locker (m_mutex); return std::find_if (m_locations.begin(), @@ -140,7 +140,7 @@ BreakpointLocationList::GetIDConstIterator (lldb::user_id_t break_id) const } BreakpointLocationSP -BreakpointLocationList::FindByID (lldb::user_id_t break_id) +BreakpointLocationList::FindByID (lldb::break_id_t break_id) { Mutex::Locker locker (m_mutex); BreakpointLocationSP stop_sp; @@ -152,7 +152,7 @@ BreakpointLocationList::FindByID (lldb::user_id_t break_id) } const BreakpointLocationSP -BreakpointLocationList::FindByID (lldb::user_id_t break_id) const +BreakpointLocationList::FindByID (lldb::break_id_t break_id) const { Mutex::Locker locker (m_mutex); BreakpointLocationSP stop_sp; @@ -192,13 +192,6 @@ BreakpointLocationList::FindInModule (Module *module, return bp_loc_list.GetSize() - orig_size; } - -static int -FindLocationByAddress (Address *addr_ptr, const BreakpointLocationSP *bp_loc_sp_ptr) -{ - return Address::CompareModulePointerAndOffset(*addr_ptr, (*bp_loc_sp_ptr)->GetAddress()); -} - const BreakpointLocationSP BreakpointLocationList::FindByAddress (Address &addr) const { @@ -234,7 +227,7 @@ BreakpointLocationList::GetByIndex (uint32_t i) { Mutex::Locker locker (m_mutex); BreakpointLocationSP stop_sp; - if (i >= 0 && i < m_locations.size()) + if (i < m_locations.size()) stop_sp = m_locations[i]; return stop_sp; @@ -245,7 +238,7 @@ BreakpointLocationList::GetByIndex (uint32_t i) const { Mutex::Locker locker (m_mutex); BreakpointLocationSP stop_sp; - if (i >= 0 && i < m_locations.size()) + if (i < m_locations.size()) stop_sp = m_locations[i]; return stop_sp; diff --git a/lldb/source/Breakpoint/BreakpointOptions.cpp b/lldb/source/Breakpoint/BreakpointOptions.cpp index aa89c442bea..9054f3b89a6 100644 --- a/lldb/source/Breakpoint/BreakpointOptions.cpp +++ b/lldb/source/Breakpoint/BreakpointOptions.cpp @@ -32,8 +32,8 @@ BreakpointOptions::NullCallback (void *baton, StoppointCallbackContext *context, //---------------------------------------------------------------------- BreakpointOptions::BreakpointOptions() : m_callback (BreakpointOptions::NullCallback), - m_callback_is_synchronous (false), m_callback_baton_sp (), + m_callback_is_synchronous (false), m_enabled (true), m_ignore_count (0), m_thread_spec_ap (NULL) @@ -160,14 +160,14 @@ BreakpointOptions::SetEnabled (bool enabled) m_enabled = enabled; } -int32_t +uint32_t BreakpointOptions::GetIgnoreCount () const { return m_ignore_count; } void -BreakpointOptions::SetIgnoreCount (int32_t n) +BreakpointOptions::SetIgnoreCount (uint32_t n) { m_ignore_count = n; } diff --git a/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp b/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp index da015dc8191..cb620f9a853 100644 --- a/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp +++ b/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp @@ -59,7 +59,7 @@ BreakpointResolverFileLine::SearchCallback Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_BREAKPOINTS); sc_list_size = cu->ResolveSymbolContext (m_file_spec, m_line_number, m_inlines, false, eSymbolContextEverything, sc_list); - for (int i = 0; i < sc_list_size; i++) + for (uint32_t i = 0; i < sc_list_size; i++) { SymbolContext sc; if (sc_list.GetContextAtIndex(i, sc)) diff --git a/lldb/source/Breakpoint/BreakpointSite.cpp b/lldb/source/Breakpoint/BreakpointSite.cpp index d9397fcb412..082a9379a90 100644 --- a/lldb/source/Breakpoint/BreakpointSite.cpp +++ b/lldb/source/Breakpoint/BreakpointSite.cpp @@ -40,7 +40,8 @@ BreakpointSite::BreakpointSite BreakpointSite::~BreakpointSite() { BreakpointLocationSP bp_loc_sp; - for (int i = 0; i < m_owners.GetSize(); i++) + const size_t owner_count = m_owners.GetSize(); + for (size_t i = 0; i < owner_count; i++) { m_owners.GetByIndex(i)->ClearBreakpointSite(); } @@ -66,7 +67,8 @@ BreakpointSite::ShouldStop (StoppointCallbackContext *context) bool BreakpointSite::IsBreakpointAtThisSite (lldb::break_id_t bp_id) { - for (int i = 0; i < m_owners.GetSize(); i++) + const size_t owner_count = m_owners.GetSize(); + for (size_t i = 0; i < owner_count; i++) { if (m_owners.GetByIndex(i)->GetBreakpoint().GetID() == bp_id) return true; @@ -158,7 +160,7 @@ BreakpointSite::AddOwner (BreakpointLocationSP &owner) } uint32_t -BreakpointSite::RemoveOwner (lldb::user_id_t break_id, lldb::user_id_t break_loc_id) +BreakpointSite::RemoveOwner (lldb::break_id_t break_id, lldb::break_id_t break_loc_id) { m_owners.Remove(break_id, break_loc_id); return m_owners.GetSize(); diff --git a/lldb/source/Breakpoint/BreakpointSiteList.cpp b/lldb/source/Breakpoint/BreakpointSiteList.cpp index 919ec452617..9a5ee92f37b 100644 --- a/lldb/source/Breakpoint/BreakpointSiteList.cpp +++ b/lldb/source/Breakpoint/BreakpointSiteList.cpp @@ -31,7 +31,7 @@ BreakpointSiteList::~BreakpointSiteList() // Add breakpoint site to the list. However, if the element already exists in the // list, then we don't add it, and return LLDB_INVALID_BREAK_ID. -lldb::user_id_t +lldb::break_id_t BreakpointSiteList::Add(const BreakpointSiteSP &bp) { lldb::addr_t bp_site_load_addr = bp->GetLoadAddress(); @@ -49,7 +49,7 @@ BreakpointSiteList::Add(const BreakpointSiteSP &bp) } bool -BreakpointSiteList::ShouldStop (StoppointCallbackContext *context, lldb::user_id_t break_id) +BreakpointSiteList::ShouldStop (StoppointCallbackContext *context, lldb::break_id_t break_id) { BreakpointSiteSP bp = FindByID (break_id); if (bp) @@ -63,7 +63,7 @@ BreakpointSiteList::ShouldStop (StoppointCallbackContext *context, lldb::user_id // doesn't exist. return true; } -lldb::user_id_t +lldb::break_id_t BreakpointSiteList::FindIDByAddress (lldb::addr_t addr) { BreakpointSiteSP bp = FindByAddress (addr); @@ -77,7 +77,7 @@ BreakpointSiteList::FindIDByAddress (lldb::addr_t addr) } bool -BreakpointSiteList::Remove (lldb::user_id_t break_id) +BreakpointSiteList::Remove (lldb::break_id_t break_id) { collection::iterator pos = GetIDIterator(break_id); // Predicate if (pos != m_bp_site_list.end()) @@ -103,7 +103,7 @@ BreakpointSiteList::RemoveByAddress (lldb::addr_t address) class BreakpointSiteIDMatches { public: - BreakpointSiteIDMatches (lldb::user_id_t break_id) : + BreakpointSiteIDMatches (lldb::break_id_t break_id) : m_break_id(break_id) { } @@ -114,25 +114,25 @@ public: } private: - const lldb::user_id_t m_break_id; + const lldb::break_id_t m_break_id; }; BreakpointSiteList::collection::iterator -BreakpointSiteList::GetIDIterator (lldb::user_id_t break_id) +BreakpointSiteList::GetIDIterator (lldb::break_id_t break_id) { return std::find_if(m_bp_site_list.begin(), m_bp_site_list.end(), // Search full range BreakpointSiteIDMatches(break_id)); // Predicate } BreakpointSiteList::collection::const_iterator -BreakpointSiteList::GetIDConstIterator (lldb::user_id_t break_id) const +BreakpointSiteList::GetIDConstIterator (lldb::break_id_t break_id) const { return std::find_if(m_bp_site_list.begin(), m_bp_site_list.end(), // Search full range BreakpointSiteIDMatches(break_id)); // Predicate } BreakpointSiteSP -BreakpointSiteList::FindByID (lldb::user_id_t break_id) +BreakpointSiteList::FindByID (lldb::break_id_t break_id) { BreakpointSiteSP stop_sp; collection::iterator pos = GetIDIterator(break_id); @@ -143,7 +143,7 @@ BreakpointSiteList::FindByID (lldb::user_id_t break_id) } const BreakpointSiteSP -BreakpointSiteList::FindByID (lldb::user_id_t break_id) const +BreakpointSiteList::FindByID (lldb::break_id_t break_id) const { BreakpointSiteSP stop_sp; collection::const_iterator pos = GetIDConstIterator(break_id); @@ -210,7 +210,7 @@ BreakpointSiteList::GetByIndex (uint32_t i) const } void -BreakpointSiteList::SetEnabledForAll (const bool enabled, const lldb::user_id_t except_id) +BreakpointSiteList::SetEnabledForAll (const bool enabled, const lldb::break_id_t except_id) { collection::iterator end = m_bp_site_list.end(); collection::iterator pos; diff --git a/lldb/source/Breakpoint/Makefile b/lldb/source/Breakpoint/Makefile new file mode 100644 index 00000000000..223e4c24465 --- /dev/null +++ b/lldb/source/Breakpoint/Makefile @@ -0,0 +1,14 @@ +##===- source/Breakpoint/Makefile --------------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +LLDB_LEVEL := ../.. +LIBRARYNAME := lldbBreakpoint +BUILD_ARCHIVE = 1 + +include $(LLDB_LEVEL)/Makefile diff --git a/lldb/source/Breakpoint/StoppointLocation.cpp b/lldb/source/Breakpoint/StoppointLocation.cpp index 60280ef2748..8d7325f0389 100644 --- a/lldb/source/Breakpoint/StoppointLocation.cpp +++ b/lldb/source/Breakpoint/StoppointLocation.cpp @@ -22,21 +22,21 @@ using namespace lldb_private; //---------------------------------------------------------------------- StoppointLocation::StoppointLocation (break_id_t bid, addr_t addr, bool hardware) : m_loc_id(bid), - m_byte_size(0), m_addr(addr), - m_hit_count(0), m_hw_preferred(hardware), - m_hw_index(LLDB_INVALID_INDEX32) + m_hw_index(LLDB_INVALID_INDEX32), + m_byte_size(0), + m_hit_count(0) { } StoppointLocation::StoppointLocation (break_id_t bid, addr_t addr, size_t size, bool hardware) : m_loc_id(bid), - m_byte_size(size), m_addr(addr), - m_hit_count(0), m_hw_preferred(hardware), - m_hw_index(LLDB_INVALID_INDEX32) + m_hw_index(LLDB_INVALID_INDEX32), + m_byte_size(size), + m_hit_count(0) { } diff --git a/lldb/source/Breakpoint/WatchpointLocation.cpp b/lldb/source/Breakpoint/WatchpointLocation.cpp index bf24421a091..c4bd975cdde 100644 --- a/lldb/source/Breakpoint/WatchpointLocation.cpp +++ b/lldb/source/Breakpoint/WatchpointLocation.cpp @@ -123,14 +123,14 @@ WatchpointLocation::WatchpointWrite () const { return m_watch_write != 0; } -int32_t +uint32_t WatchpointLocation::GetIgnoreCount () const { return m_ignore_count; } void -WatchpointLocation::SetIgnoreCount (int32_t n) +WatchpointLocation::SetIgnoreCount (uint32_t n) { m_ignore_count = n; } |