summaryrefslogtreecommitdiffstats
path: root/lldb/source/Breakpoint/BreakpointLocationList.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-11-09 00:03:31 +0000
committerGreg Clayton <gclayton@apple.com>2013-11-09 00:03:31 +0000
commitb35db6399dd8ab092bd45c10d1a76e10fae2dad7 (patch)
tree2241777d807b54db63858e7274e253acf1dc2413 /lldb/source/Breakpoint/BreakpointLocationList.cpp
parent1b6973fc99e381bf8b8f5036502193b8219f4d5e (diff)
downloadbcm5719-llvm-b35db6399dd8ab092bd45c10d1a76e10fae2dad7.tar.gz
bcm5719-llvm-b35db6399dd8ab092bd45c10d1a76e10fae2dad7.zip
Fixed the the breakpoint test case failures.
There were 6 on darwin. All of these were related to the recent changes for exec. llvm-svn: 194298
Diffstat (limited to 'lldb/source/Breakpoint/BreakpointLocationList.cpp')
-rw-r--r--lldb/source/Breakpoint/BreakpointLocationList.cpp39
1 files changed, 38 insertions, 1 deletions
diff --git a/lldb/source/Breakpoint/BreakpointLocationList.cpp b/lldb/source/Breakpoint/BreakpointLocationList.cpp
index 341b0971630..8be3d9b67e2 100644
--- a/lldb/source/Breakpoint/BreakpointLocationList.cpp
+++ b/lldb/source/Breakpoint/BreakpointLocationList.cpp
@@ -13,8 +13,11 @@
// Other libraries and framework includes
// Project includes
#include "lldb/Breakpoint/BreakpointLocationList.h"
+
#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Breakpoint/Breakpoint.h"
+#include "lldb/Core/ArchSpec.h"
+#include "lldb/Core/Module.h"
#include "lldb/Core/Section.h"
#include "lldb/Target/Target.h"
@@ -286,7 +289,41 @@ BreakpointLocationList::RemoveLocation (const lldb::BreakpointLocationSP &bp_loc
return false;
}
-
+void
+BreakpointLocationList::RemoveInvalidLocations (const ArchSpec &arch)
+{
+ Mutex::Locker locker (m_mutex);
+ size_t idx = 0;
+ // Don't cache m_location.size() as it will change since we might
+ // remove locations from our vector...
+ while (idx < m_locations.size())
+ {
+ BreakpointLocation *bp_loc = m_locations[idx].get();
+ if (bp_loc->GetAddress().SectionWasDeleted())
+ {
+ // Section was deleted which means this breakpoint comes from a module
+ // that is no longer valid, so we should remove it.
+ m_locations.erase(m_locations.begin() + idx);
+ continue;
+ }
+ if (arch.IsValid())
+ {
+ ModuleSP module_sp (bp_loc->GetAddress().GetModule());
+ if (module_sp)
+ {
+ if (!arch.IsCompatibleMatch(module_sp->GetArchitecture()))
+ {
+ // The breakpoint was in a module whose architecture is no longer
+ // compatible with "arch", so we need to remove it
+ m_locations.erase(m_locations.begin() + idx);
+ continue;
+ }
+ }
+ }
+ // Only increment the index if we didn't remove the locations at index "idx"
+ ++idx;
+ }
+}
void
BreakpointLocationList::StartRecordingNewLocations (BreakpointLocationCollection &new_locations)
OpenPOWER on IntegriCloud