From aa794b38fedea0f2e99519975acab0b289714b41 Mon Sep 17 00:00:00 2001 From: emaste Date: Wed, 23 Jul 2014 19:35:02 +0000 Subject: MFC r262528: Update LLDB snapshot to upstream r202189 Highlights include (upstream revs in parens): - Improvements to the remote GDB protocol client (r196610, r197579, r197857, r200072, and others) - Bug fixes for big-endian targets (r196808) - Initial support for libdispatch (GCD) queues in the debuggee (r197190) - Add "step-avoid-libraries" setting (r199943) - IO subsystem improvements (including initial work on a curses gui) (r200263) - Support hardware watchpoints on FreeBSD (r201706) - Improved unwinding through hand-written assembly functions (r201839) - Handle DW_TAG_unspecified_parameters for variadic functions (r202061) - Fix Ctrl+C interrupting a running inferior process (r202086, r202154) - Various bug fixes for memory leaks, LLDB segfaults, the C++ demangler, ELF core files, DWARF debug info, and others. Sponsored by: DARPA, AFRL --- .../lldb/source/Target/ThreadPlanStepInRange.cpp | 33 ++++++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'contrib/llvm/tools/lldb/source/Target/ThreadPlanStepInRange.cpp') diff --git a/contrib/llvm/tools/lldb/source/Target/ThreadPlanStepInRange.cpp b/contrib/llvm/tools/lldb/source/Target/ThreadPlanStepInRange.cpp index 2cfd29f..c4cb9ab 100644 --- a/contrib/llvm/tools/lldb/source/Target/ThreadPlanStepInRange.cpp +++ b/contrib/llvm/tools/lldb/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 (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 (); } } -- cgit v1.1