From 17d023f6ac0326706aa7726895550c015befb451 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Wed, 13 Mar 2013 17:58:04 +0000 Subject: [PATCH] Add a target setting (target.use-fast-stepping) to control using the "run to next branch" stepping algorithm. llvm-svn: 176958 --- lldb/include/lldb/Target/Target.h | 5 ++++- lldb/source/Target/Target.cpp | 11 ++++++++++- lldb/source/Target/ThreadPlanStepRange.cpp | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lldb/include/lldb/Target/Target.h b/lldb/include/lldb/Target/Target.h index 282a8fa3fde8..928b7e3ab072 100644 --- a/lldb/include/lldb/Target/Target.h +++ b/lldb/include/lldb/Target/Target.h @@ -144,7 +144,10 @@ public: const char * GetExpressionPrefixContentsAsCString (); - + + bool + GetUseFastStepping() const; + }; typedef STD_SHARED_PTR(TargetProperties) TargetPropertiesSP; diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 1cc48dcc665a..9e9aa563f7d4 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -2261,6 +2261,7 @@ g_properties[] = "file and line breakpoints." }, // FIXME: This is the wrong way to do per-architecture settings, but we don't have a general per architecture settings system in place yet. { "x86-disassembly-flavor" , OptionValue::eTypeEnum , false, eX86DisFlavorDefault, NULL, g_x86_dis_flavor_value_types, "The default disassembly flavor to use for x86 or x86-64 targets." }, + { "use-fast-stepping" , OptionValue::eTypeBoolean , false, false, NULL, NULL, "Use a fast stepping algorithm based on running from branch to branch rather than instruction single-stepping." }, { NULL , OptionValue::eTypeInvalid , false, 0 , NULL, NULL, NULL } }; enum @@ -2285,7 +2286,8 @@ enum ePropertyDisableASLR, ePropertyDisableSTDIO, ePropertyInlineStrategy, - ePropertyDisassemblyFlavor + ePropertyDisassemblyFlavor, + ePropertyUseFastStepping }; @@ -2624,6 +2626,13 @@ TargetProperties::GetBreakpointsConsultPlatformAvoidList () return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0); } +bool +TargetProperties::GetUseFastStepping () const +{ + const uint32_t idx = ePropertyUseFastStepping; + return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0); +} + const TargetPropertiesSP & Target::GetGlobalProperties() { diff --git a/lldb/source/Target/ThreadPlanStepRange.cpp b/lldb/source/Target/ThreadPlanStepRange.cpp index 52048064d2c5..7f93f3fe8f9a 100644 --- a/lldb/source/Target/ThreadPlanStepRange.cpp +++ b/lldb/source/Target/ThreadPlanStepRange.cpp @@ -54,6 +54,7 @@ ThreadPlanStepRange::ThreadPlanStepRange (ThreadPlanKind kind, m_first_run_event (true), m_use_fast_step(false) { + m_use_fast_step = GetTarget().GetUseFastStepping(); AddRange(range); m_stack_id = m_thread.GetStackFrameAtIndex(0)->GetStackID(); }