summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/lldb/source/Target/Thread.cpp
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2014-02-18 19:52:51 +0000
committeremaste <emaste@FreeBSD.org>2014-02-18 19:52:51 +0000
commitf5e6858941423ebbd5f369ae041fdd8ae1ff404d (patch)
tree4b7112f641e225f50ba2fb8b4053a0f56c45662f /contrib/llvm/tools/lldb/source/Target/Thread.cpp
parentdc56a06bc6654ce03ea11356a755fbdcae2b7608 (diff)
parent6beac4fcf9e5327f07c0fefd527180124438096a (diff)
downloadFreeBSD-src-f5e6858941423ebbd5f369ae041fdd8ae1ff404d.zip
FreeBSD-src-f5e6858941423ebbd5f369ae041fdd8ae1ff404d.tar.gz
Update LLDB snapshot to upstream r201577
Highlights include: - Improvements to the remote GDB protocol client (r196610, r197579, r197857, r200072) - 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) - Various bug fixes for memory leaks, LLDB segfaults, the C++ demangler, ELF core files, DWARF debug info, and others. Sponsored by: DARPA, AFRL
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Target/Thread.cpp')
-rw-r--r--contrib/llvm/tools/lldb/source/Target/Thread.cpp134
1 files changed, 134 insertions, 0 deletions
diff --git a/contrib/llvm/tools/lldb/source/Target/Thread.cpp b/contrib/llvm/tools/lldb/source/Target/Thread.cpp
index 07f5321..72de5b8 100644
--- a/contrib/llvm/tools/lldb/source/Target/Thread.cpp
+++ b/contrib/llvm/tools/lldb/source/Target/Thread.cpp
@@ -18,6 +18,7 @@
#include "lldb/Core/StreamString.h"
#include "lldb/Core/RegularExpression.h"
#include "lldb/Host/Host.h"
+#include "lldb/Interpreter/OptionValueFileSpecList.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Target/DynamicLoader.h"
#include "lldb/Target/ExecutionContext.h"
@@ -61,12 +62,14 @@ static PropertyDefinition
g_properties[] =
{
{ "step-avoid-regexp", OptionValue::eTypeRegex , true , REG_EXTENDED, "^std::", NULL, "A regular expression defining functions step-in won't stop in." },
+ { "step-avoid-libraries", OptionValue::eTypeFileSpecList , true , REG_EXTENDED, NULL, NULL, "A list of libraries that source stepping won't stop in." },
{ "trace-thread", OptionValue::eTypeBoolean, false, false, NULL, NULL, "If true, this thread will single-step and log execution." },
{ NULL , OptionValue::eTypeInvalid, false, 0 , NULL, NULL, NULL }
};
enum {
ePropertyStepAvoidRegex,
+ ePropertyStepAvoidLibraries,
ePropertyEnableThreadTrace
};
@@ -132,6 +135,15 @@ ThreadProperties::GetSymbolsToAvoidRegexp()
return m_collection_sp->GetPropertyAtIndexAsOptionValueRegex (NULL, idx);
}
+FileSpecList &
+ThreadProperties::GetLibrariesToAvoid() const
+{
+ const uint32_t idx = ePropertyStepAvoidLibraries;
+ OptionValueFileSpecList *option_value = m_collection_sp->GetPropertyAtIndexAsOptionValueFileSpecList (NULL, false, idx);
+ assert(option_value);
+ return option_value->GetCurrentValue();
+}
+
bool
ThreadProperties::GetTraceEnabledState() const
{
@@ -2053,3 +2065,125 @@ Thread::IsStillAtLastBreakpointHit ()
}
return false;
}
+
+
+Error
+Thread::StepIn (bool source_step,
+ bool avoid_code_without_debug_info)
+
+{
+ Error error;
+ Process *process = GetProcess().get();
+ if (StateIsStoppedState (process->GetState(), true))
+ {
+ StackFrameSP frame_sp = GetStackFrameAtIndex (0);
+ ThreadPlanSP new_plan_sp;
+ const lldb::RunMode run_mode = eOnlyThisThread;
+ const bool abort_other_plans = false;
+
+ if (source_step && frame_sp && frame_sp->HasDebugInformation ())
+ {
+ SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
+ new_plan_sp = QueueThreadPlanForStepInRange (abort_other_plans,
+ sc.line_entry.range,
+ sc,
+ NULL,
+ run_mode,
+ avoid_code_without_debug_info);
+ }
+ else
+ {
+ new_plan_sp = QueueThreadPlanForStepSingleInstruction (false,
+ abort_other_plans,
+ run_mode);
+ }
+
+ new_plan_sp->SetIsMasterPlan(true);
+ new_plan_sp->SetOkayToDiscard(false);
+
+ // Why do we need to set the current thread by ID here???
+ process->GetThreadList().SetSelectedThreadByID (GetID());
+ error = process->Resume();
+ }
+ else
+ {
+ error.SetErrorString("process not stopped");
+ }
+ return error;
+}
+
+Error
+Thread::StepOver (bool source_step)
+
+{
+ Error error;
+ Process *process = GetProcess().get();
+ if (StateIsStoppedState (process->GetState(), true))
+ {
+ StackFrameSP frame_sp = GetStackFrameAtIndex (0);
+ ThreadPlanSP new_plan_sp;
+
+ const lldb::RunMode run_mode = eOnlyThisThread;
+ const bool abort_other_plans = false;
+
+ if (source_step && frame_sp && frame_sp->HasDebugInformation ())
+ {
+ SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
+ new_plan_sp = QueueThreadPlanForStepOverRange (abort_other_plans,
+ sc.line_entry.range,
+ sc,
+ run_mode);
+ }
+ else
+ {
+ new_plan_sp = QueueThreadPlanForStepSingleInstruction (true,
+ abort_other_plans,
+ run_mode);
+ }
+
+ new_plan_sp->SetIsMasterPlan(true);
+ new_plan_sp->SetOkayToDiscard(false);
+
+ // Why do we need to set the current thread by ID here???
+ process->GetThreadList().SetSelectedThreadByID (GetID());
+ error = process->Resume();
+ }
+ else
+ {
+ error.SetErrorString("process not stopped");
+ }
+ return error;
+}
+
+Error
+Thread::StepOut ()
+{
+ Error error;
+ Process *process = GetProcess().get();
+ if (StateIsStoppedState (process->GetState(), true))
+ {
+ const bool first_instruction = false;
+ const bool stop_other_threads = false;
+ const bool abort_other_plans = false;
+
+ ThreadPlanSP new_plan_sp(QueueThreadPlanForStepOut (abort_other_plans,
+ NULL,
+ first_instruction,
+ stop_other_threads,
+ eVoteYes,
+ eVoteNoOpinion,
+ 0));
+
+ new_plan_sp->SetIsMasterPlan(true);
+ new_plan_sp->SetOkayToDiscard(false);
+
+ // Why do we need to set the current thread by ID here???
+ process->GetThreadList().SetSelectedThreadByID (GetID());
+ error = process->Resume();
+ }
+ else
+ {
+ error.SetErrorString("process not stopped");
+ }
+ return error;
+} \ No newline at end of file
OpenPOWER on IntegriCloud