summaryrefslogtreecommitdiffstats
path: root/source/Target/ThreadPlanStepInRange.cpp
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2014-02-18 16:23:10 +0000
committeremaste <emaste@FreeBSD.org>2014-02-18 16:23:10 +0000
commit6beac4fcf9e5327f07c0fefd527180124438096a (patch)
tree95cb16075f0af1b3a05b9b84eb18dda8e6c903e9 /source/Target/ThreadPlanStepInRange.cpp
parentf087960a1097db2a1ef14a88963f8785df239aaa (diff)
downloadFreeBSD-src-6beac4fcf9e5327f07c0fefd527180124438096a.zip
FreeBSD-src-6beac4fcf9e5327f07c0fefd527180124438096a.tar.gz
Import lldb as of SVN r201577 (git 2bdc2f6)
(A number of files not required for the FreeBSD build have been removed.) Sponsored by: DARPA, AFRL
Diffstat (limited to 'source/Target/ThreadPlanStepInRange.cpp')
-rw-r--r--source/Target/ThreadPlanStepInRange.cpp33
1 files changed, 30 insertions, 3 deletions
diff --git a/source/Target/ThreadPlanStepInRange.cpp b/source/Target/ThreadPlanStepInRange.cpp
index 2cfd29f..c4cb9ab 100644
--- a/source/Target/ThreadPlanStepInRange.cpp
+++ b/source/Target/ThreadPlanStepInRange.cpp
@@ -16,6 +16,7 @@
#include "lldb/lldb-private-log.h"
#include "lldb/Core/Log.h"
+#include "lldb/Core/Module.h"
#include "lldb/Core/Stream.h"
#include "lldb/Symbol/Symbol.h"
#include "lldb/Symbol/Function.h"
@@ -273,10 +274,36 @@ ThreadPlanStepInRange::SetDefaultFlagValue (uint32_t new_value)
}
bool
-ThreadPlanStepInRange::FrameMatchesAvoidRegexp ()
+ThreadPlanStepInRange::FrameMatchesAvoidCriteria ()
{
StackFrame *frame = GetThread().GetStackFrameAtIndex(0).get();
+
+ // Check the library list first, as that's cheapest:
+ bool libraries_say_avoid = false;
+ FileSpecList libraries_to_avoid (GetThread().GetLibrariesToAvoid());
+ size_t num_libraries = libraries_to_avoid.GetSize();
+ if (num_libraries > 0)
+ {
+ SymbolContext sc(frame->GetSymbolContext(eSymbolContextModule));
+ FileSpec frame_library(sc.module_sp->GetFileSpec());
+
+ if (frame_library)
+ {
+ for (size_t i = 0; i < num_libraries; i++)
+ {
+ const FileSpec &file_spec(libraries_to_avoid.GetFileSpecAtIndex(i));
+ if (FileSpec::Equal (file_spec, frame_library, false))
+ {
+ libraries_say_avoid = true;
+ break;
+ }
+ }
+ }
+ }
+ if (libraries_say_avoid)
+ return true;
+
const RegularExpression *avoid_regexp_to_use = m_avoid_regexp_ap.get();
if (avoid_regexp_to_use == NULL)
avoid_regexp_to_use = GetThread().GetSymbolsToAvoidRegexp();
@@ -368,8 +395,8 @@ ThreadPlanStepInRange::DefaultShouldStopHereCallback (ThreadPlan *current_plan,
if (!should_step_out)
{
ThreadPlanStepInRange *step_in_range_plan = static_cast<ThreadPlanStepInRange *> (current_plan);
- // Don't log the should_step_out here, it's easier to do it in FrameMatchesAvoidRegexp.
- should_step_out = step_in_range_plan->FrameMatchesAvoidRegexp ();
+ // Don't log the should_step_out here, it's easier to do it in FrameMatchesAvoidCriteria.
+ should_step_out = step_in_range_plan->FrameMatchesAvoidCriteria ();
}
}
OpenPOWER on IntegriCloud