2010-06-09 00:52:24 +08:00
|
|
|
//===-- ThreadPlanStepInRange.cpp -------------------------------*- C++ -*-===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2010-06-09 00:52:24 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2015-12-15 09:33:19 +08:00
|
|
|
#include "lldb/Target/ThreadPlanStepInRange.h"
|
2018-03-13 05:17:04 +08:00
|
|
|
#include "lldb/Core/Architecture.h"
|
2014-01-24 05:52:47 +08:00
|
|
|
#include "lldb/Core/Module.h"
|
2010-09-16 08:58:09 +08:00
|
|
|
#include "lldb/Symbol/Function.h"
|
2010-07-10 10:27:39 +08:00
|
|
|
#include "lldb/Symbol/Symbol.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/Target/Process.h"
|
|
|
|
#include "lldb/Target/RegisterContext.h"
|
2018-03-13 05:17:04 +08:00
|
|
|
#include "lldb/Target/SectionLoadList.h"
|
2011-02-16 05:59:32 +08:00
|
|
|
#include "lldb/Target/Target.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/Target/Thread.h"
|
|
|
|
#include "lldb/Target/ThreadPlanStepOut.h"
|
|
|
|
#include "lldb/Target/ThreadPlanStepThrough.h"
|
2017-03-04 04:56:28 +08:00
|
|
|
#include "lldb/Utility/Log.h"
|
2017-02-03 05:39:50 +08:00
|
|
|
#include "lldb/Utility/RegularExpression.h"
|
|
|
|
#include "lldb/Utility/Stream.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
using namespace lldb;
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
2014-03-13 10:47:14 +08:00
|
|
|
uint32_t ThreadPlanStepInRange::s_default_flag_values =
|
|
|
|
ThreadPlanShouldStopHere::eStepInAvoidNoDebug;
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
// ThreadPlanStepInRange: Step through a stack range, either stepping over or
|
2018-05-01 00:49:04 +08:00
|
|
|
// into based on the value of \a type.
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
ThreadPlanStepInRange::ThreadPlanStepInRange(
|
|
|
|
Thread &thread, const AddressRange &range,
|
|
|
|
const SymbolContext &addr_context, lldb::RunMode stop_others,
|
2014-03-13 10:47:14 +08:00
|
|
|
LazyBool step_in_avoids_code_without_debug_info,
|
|
|
|
LazyBool step_out_avoids_code_without_debug_info)
|
2010-06-19 12:45:32 +08:00
|
|
|
: ThreadPlanStepRange(ThreadPlan::eKindStepInRange,
|
|
|
|
"Step Range stepping in", thread, range, addr_context,
|
|
|
|
stop_others),
|
2014-03-13 10:47:14 +08:00
|
|
|
ThreadPlanShouldStopHere(this), m_step_past_prologue(true),
|
2012-09-07 09:11:44 +08:00
|
|
|
m_virtual_step(false) {
|
2014-03-13 10:47:14 +08:00
|
|
|
SetCallbacks();
|
2010-06-09 00:52:24 +08:00
|
|
|
SetFlagsToDefault();
|
2014-03-13 10:47:14 +08:00
|
|
|
SetupAvoidNoDebug(step_in_avoids_code_without_debug_info,
|
|
|
|
step_out_avoids_code_without_debug_info);
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
Fixed a few bugs in the "step in" thread plan logic.
Added a "step-in-target" flag to "thread step-in" so if you have something like:
Process 28464 stopped
* thread #1: tid = 0x1c03, function: main , stop reason = breakpoint 1.1
frame #0: 0x0000000100000e08 a.out`main at main.c:62
61
-> 62 int A6 = complex (a(4), b(5), c(6)); // Stop here to step targetting b and hitting breakpoint.
63
and you want to get into "complex" skipping a, b and c, you can do:
(lldb) step -t complex
Process 28464 stopped
* thread #1: tid = 0x1c03, function: complex , stop reason = step in
frame #0: 0x0000000100000d0d a.out`complex at main.c:44
41
42 int complex (int first, int second, int third)
43 {
-> 44 return first + second + third; // Step in targetting complex should stop here
45 }
46
47 int main (int argc, char const *argv[])
llvm-svn: 170008
2012-12-13 03:58:40 +08:00
|
|
|
ThreadPlanStepInRange::ThreadPlanStepInRange(
|
|
|
|
Thread &thread, const AddressRange &range,
|
|
|
|
const SymbolContext &addr_context, const char *step_into_target,
|
2014-03-13 10:47:14 +08:00
|
|
|
lldb::RunMode stop_others, LazyBool step_in_avoids_code_without_debug_info,
|
|
|
|
LazyBool step_out_avoids_code_without_debug_info)
|
Fixed a few bugs in the "step in" thread plan logic.
Added a "step-in-target" flag to "thread step-in" so if you have something like:
Process 28464 stopped
* thread #1: tid = 0x1c03, function: main , stop reason = breakpoint 1.1
frame #0: 0x0000000100000e08 a.out`main at main.c:62
61
-> 62 int A6 = complex (a(4), b(5), c(6)); // Stop here to step targetting b and hitting breakpoint.
63
and you want to get into "complex" skipping a, b and c, you can do:
(lldb) step -t complex
Process 28464 stopped
* thread #1: tid = 0x1c03, function: complex , stop reason = step in
frame #0: 0x0000000100000d0d a.out`complex at main.c:44
41
42 int complex (int first, int second, int third)
43 {
-> 44 return first + second + third; // Step in targetting complex should stop here
45 }
46
47 int main (int argc, char const *argv[])
llvm-svn: 170008
2012-12-13 03:58:40 +08:00
|
|
|
: ThreadPlanStepRange(ThreadPlan::eKindStepInRange,
|
|
|
|
"Step Range stepping in", thread, range, addr_context,
|
|
|
|
stop_others),
|
2014-03-13 10:47:14 +08:00
|
|
|
ThreadPlanShouldStopHere(this), m_step_past_prologue(true),
|
Fixed a few bugs in the "step in" thread plan logic.
Added a "step-in-target" flag to "thread step-in" so if you have something like:
Process 28464 stopped
* thread #1: tid = 0x1c03, function: main , stop reason = breakpoint 1.1
frame #0: 0x0000000100000e08 a.out`main at main.c:62
61
-> 62 int A6 = complex (a(4), b(5), c(6)); // Stop here to step targetting b and hitting breakpoint.
63
and you want to get into "complex" skipping a, b and c, you can do:
(lldb) step -t complex
Process 28464 stopped
* thread #1: tid = 0x1c03, function: complex , stop reason = step in
frame #0: 0x0000000100000d0d a.out`complex at main.c:44
41
42 int complex (int first, int second, int third)
43 {
-> 44 return first + second + third; // Step in targetting complex should stop here
45 }
46
47 int main (int argc, char const *argv[])
llvm-svn: 170008
2012-12-13 03:58:40 +08:00
|
|
|
m_virtual_step(false), m_step_into_target(step_into_target) {
|
2014-03-13 10:47:14 +08:00
|
|
|
SetCallbacks();
|
Fixed a few bugs in the "step in" thread plan logic.
Added a "step-in-target" flag to "thread step-in" so if you have something like:
Process 28464 stopped
* thread #1: tid = 0x1c03, function: main , stop reason = breakpoint 1.1
frame #0: 0x0000000100000e08 a.out`main at main.c:62
61
-> 62 int A6 = complex (a(4), b(5), c(6)); // Stop here to step targetting b and hitting breakpoint.
63
and you want to get into "complex" skipping a, b and c, you can do:
(lldb) step -t complex
Process 28464 stopped
* thread #1: tid = 0x1c03, function: complex , stop reason = step in
frame #0: 0x0000000100000d0d a.out`complex at main.c:44
41
42 int complex (int first, int second, int third)
43 {
-> 44 return first + second + third; // Step in targetting complex should stop here
45 }
46
47 int main (int argc, char const *argv[])
llvm-svn: 170008
2012-12-13 03:58:40 +08:00
|
|
|
SetFlagsToDefault();
|
2014-03-13 10:47:14 +08:00
|
|
|
SetupAvoidNoDebug(step_in_avoids_code_without_debug_info,
|
|
|
|
step_out_avoids_code_without_debug_info);
|
Fixed a few bugs in the "step in" thread plan logic.
Added a "step-in-target" flag to "thread step-in" so if you have something like:
Process 28464 stopped
* thread #1: tid = 0x1c03, function: main , stop reason = breakpoint 1.1
frame #0: 0x0000000100000e08 a.out`main at main.c:62
61
-> 62 int A6 = complex (a(4), b(5), c(6)); // Stop here to step targetting b and hitting breakpoint.
63
and you want to get into "complex" skipping a, b and c, you can do:
(lldb) step -t complex
Process 28464 stopped
* thread #1: tid = 0x1c03, function: complex , stop reason = step in
frame #0: 0x0000000100000d0d a.out`complex at main.c:44
41
42 int complex (int first, int second, int third)
43 {
-> 44 return first + second + third; // Step in targetting complex should stop here
45 }
46
47 int main (int argc, char const *argv[])
llvm-svn: 170008
2012-12-13 03:58:40 +08:00
|
|
|
}
|
|
|
|
|
2015-12-15 09:33:19 +08:00
|
|
|
ThreadPlanStepInRange::~ThreadPlanStepInRange() = default;
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2014-03-13 10:47:14 +08:00
|
|
|
void ThreadPlanStepInRange::SetupAvoidNoDebug(
|
|
|
|
LazyBool step_in_avoids_code_without_debug_info,
|
|
|
|
LazyBool step_out_avoids_code_without_debug_info) {
|
|
|
|
bool avoid_nodebug = true;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2014-03-13 10:47:14 +08:00
|
|
|
switch (step_in_avoids_code_without_debug_info) {
|
|
|
|
case eLazyBoolYes:
|
|
|
|
avoid_nodebug = true;
|
|
|
|
break;
|
|
|
|
case eLazyBoolNo:
|
|
|
|
avoid_nodebug = false;
|
|
|
|
break;
|
|
|
|
case eLazyBoolCalculate:
|
|
|
|
avoid_nodebug = m_thread.GetStepInAvoidsNoDebug();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (avoid_nodebug)
|
|
|
|
GetFlags().Set(ThreadPlanShouldStopHere::eStepInAvoidNoDebug);
|
|
|
|
else
|
|
|
|
GetFlags().Clear(ThreadPlanShouldStopHere::eStepInAvoidNoDebug);
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2014-03-13 10:47:14 +08:00
|
|
|
switch (step_out_avoids_code_without_debug_info) {
|
|
|
|
case eLazyBoolYes:
|
|
|
|
avoid_nodebug = true;
|
|
|
|
break;
|
|
|
|
case eLazyBoolNo:
|
|
|
|
avoid_nodebug = false;
|
|
|
|
break;
|
|
|
|
case eLazyBoolCalculate:
|
|
|
|
avoid_nodebug = m_thread.GetStepOutAvoidsNoDebug();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (avoid_nodebug)
|
|
|
|
GetFlags().Set(ThreadPlanShouldStopHere::eStepOutAvoidNoDebug);
|
|
|
|
else
|
|
|
|
GetFlags().Clear(ThreadPlanShouldStopHere::eStepOutAvoidNoDebug);
|
|
|
|
}
|
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
void ThreadPlanStepInRange::GetDescription(Stream *s,
|
|
|
|
lldb::DescriptionLevel level) {
|
2018-11-15 09:18:15 +08:00
|
|
|
|
|
|
|
auto PrintFailureIfAny = [&]() {
|
|
|
|
if (m_status.Success())
|
|
|
|
return;
|
|
|
|
s->Printf(" failed (%s)", m_status.AsCString());
|
|
|
|
};
|
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
if (level == lldb::eDescriptionLevelBrief) {
|
|
|
|
s->Printf("step in");
|
2018-11-15 09:18:15 +08:00
|
|
|
PrintFailureIfAny();
|
2014-09-30 07:17:18 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
s->Printf("Stepping in");
|
|
|
|
bool printed_line_info = false;
|
|
|
|
if (m_addr_context.line_entry.IsValid()) {
|
|
|
|
s->Printf(" through line ");
|
|
|
|
m_addr_context.line_entry.DumpStopContext(s, false);
|
|
|
|
printed_line_info = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *step_into_target = m_step_into_target.AsCString();
|
|
|
|
if (step_into_target && step_into_target[0] != '\0')
|
|
|
|
s->Printf(" targeting %s", m_step_into_target.AsCString());
|
|
|
|
|
|
|
|
if (!printed_line_info || level == eDescriptionLevelVerbose) {
|
|
|
|
s->Printf(" using ranges:");
|
2011-10-15 08:24:48 +08:00
|
|
|
DumpRanges(s);
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
2014-09-30 07:17:18 +08:00
|
|
|
|
2018-11-15 09:18:15 +08:00
|
|
|
PrintFailureIfAny();
|
|
|
|
|
2014-09-30 07:17:18 +08:00
|
|
|
s->PutChar('.');
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
bool ThreadPlanStepInRange::ShouldStop(Event *event_ptr) {
|
2013-03-28 07:08:40 +08:00
|
|
|
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
if (log) {
|
2010-06-09 00:52:24 +08:00
|
|
|
StreamString s;
|
2016-09-07 04:57:50 +08:00
|
|
|
s.Address(
|
2011-02-16 05:59:32 +08:00
|
|
|
m_thread.GetRegisterContext()->GetPC(),
|
2012-02-21 08:09:25 +08:00
|
|
|
m_thread.CalculateTarget()->GetArchitecture().GetAddressByteSize());
|
2019-07-25 01:56:10 +08:00
|
|
|
LLDB_LOGF(log, "ThreadPlanStepInRange reached %s.", s.GetData());
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2011-12-03 09:52:59 +08:00
|
|
|
if (IsPlanComplete())
|
|
|
|
return true;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2013-07-19 05:48:26 +08:00
|
|
|
m_no_more_plans = false;
|
|
|
|
if (m_sub_plan_sp && m_sub_plan_sp->IsPlanComplete()) {
|
|
|
|
if (!m_sub_plan_sp->PlanSucceeded()) {
|
|
|
|
SetPlanComplete();
|
|
|
|
m_no_more_plans = true;
|
|
|
|
return true;
|
|
|
|
} else
|
|
|
|
m_sub_plan_sp.reset();
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2012-09-07 09:11:44 +08:00
|
|
|
if (m_virtual_step) {
|
|
|
|
// If we've just completed a virtual step, all we need to do is check for a
|
2018-05-01 00:49:04 +08:00
|
|
|
// ShouldStopHere plan, and otherwise we're done.
|
2014-03-13 10:47:14 +08:00
|
|
|
// FIXME - This can be both a step in and a step out. Probably should
|
|
|
|
// record which in the m_virtual_step.
|
2018-11-15 09:18:15 +08:00
|
|
|
m_sub_plan_sp =
|
|
|
|
CheckShouldStopHereAndQueueStepOut(eFrameCompareYounger, m_status);
|
2016-09-07 04:57:50 +08:00
|
|
|
} else {
|
2012-10-26 06:30:09 +08:00
|
|
|
// Stepping through should be done running other threads in general, since
|
2018-05-01 00:49:04 +08:00
|
|
|
// we're setting a breakpoint and continuing. So only stop others if we
|
|
|
|
// are explicitly told to do so.
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2015-12-15 09:33:19 +08:00
|
|
|
bool stop_others = (m_stop_others == lldb::eOnlyThisThread);
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-09-07 09:11:44 +08:00
|
|
|
FrameComparison frame_order = CompareCurrentFrameToStartFrame();
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2014-08-06 09:49:59 +08:00
|
|
|
if (frame_order == eFrameCompareOlder ||
|
|
|
|
frame_order == eFrameCompareSameParent) {
|
2012-09-07 09:11:44 +08:00
|
|
|
// If we're in an older frame then we should stop.
|
2016-09-07 04:57:50 +08:00
|
|
|
//
|
2012-09-07 09:11:44 +08:00
|
|
|
// A caveat to this is if we think the frame is older but we're actually
|
|
|
|
// in a trampoline.
|
|
|
|
// I'm going to make the assumption that you wouldn't RETURN to a
|
2018-05-01 00:49:04 +08:00
|
|
|
// trampoline. So if we are in a trampoline we think the frame is older
|
|
|
|
// because the trampoline confused the backtracer.
|
2018-11-15 09:18:15 +08:00
|
|
|
m_sub_plan_sp = m_thread.QueueThreadPlanForStepThrough(
|
|
|
|
m_stack_id, false, stop_others, m_status);
|
2013-07-19 05:48:26 +08:00
|
|
|
if (!m_sub_plan_sp) {
|
2014-03-13 10:47:14 +08:00
|
|
|
// Otherwise check the ShouldStopHere for step out:
|
2018-11-15 09:18:15 +08:00
|
|
|
m_sub_plan_sp =
|
|
|
|
CheckShouldStopHereAndQueueStepOut(frame_order, m_status);
|
2017-08-24 03:40:21 +08:00
|
|
|
if (log) {
|
|
|
|
if (m_sub_plan_sp)
|
2019-07-25 01:56:10 +08:00
|
|
|
LLDB_LOGF(log,
|
|
|
|
"ShouldStopHere found plan to step out of this frame.");
|
2017-08-24 03:40:21 +08:00
|
|
|
else
|
2019-07-25 01:56:10 +08:00
|
|
|
LLDB_LOGF(log, "ShouldStopHere no plan to step out of this frame.");
|
2017-08-24 03:40:21 +08:00
|
|
|
}
|
2012-09-07 09:11:44 +08:00
|
|
|
} else if (log) {
|
2019-07-25 01:56:10 +08:00
|
|
|
LLDB_LOGF(
|
|
|
|
log, "Thought I stepped out, but in fact arrived at a trampoline.");
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2012-09-07 09:11:44 +08:00
|
|
|
} else if (frame_order == eFrameCompareEqual && InSymbol()) {
|
2018-05-01 00:49:04 +08:00
|
|
|
// If we are not in a place we should step through, we're done. One
|
|
|
|
// tricky bit here is that some stubs don't push a frame, so we have to
|
|
|
|
// check both the case of a frame that is younger, or the same as this
|
|
|
|
// frame. However, if the frame is the same, and we are still in the
|
|
|
|
// symbol we started in, the we don't need to do this. This first check
|
|
|
|
// isn't strictly necessary, but it is more efficient.
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-09-07 09:11:44 +08:00
|
|
|
// If we're still in the range, keep going, either by running to the next
|
2018-05-01 00:49:04 +08:00
|
|
|
// branch breakpoint, or by stepping.
|
2012-09-07 09:11:44 +08:00
|
|
|
if (InRange()) {
|
|
|
|
SetNextBranchBreakpoint();
|
|
|
|
return false;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2012-09-07 09:11:44 +08:00
|
|
|
SetPlanComplete();
|
Fixed a few bugs in the "step in" thread plan logic.
Added a "step-in-target" flag to "thread step-in" so if you have something like:
Process 28464 stopped
* thread #1: tid = 0x1c03, function: main , stop reason = breakpoint 1.1
frame #0: 0x0000000100000e08 a.out`main at main.c:62
61
-> 62 int A6 = complex (a(4), b(5), c(6)); // Stop here to step targetting b and hitting breakpoint.
63
and you want to get into "complex" skipping a, b and c, you can do:
(lldb) step -t complex
Process 28464 stopped
* thread #1: tid = 0x1c03, function: complex , stop reason = step in
frame #0: 0x0000000100000d0d a.out`complex at main.c:44
41
42 int complex (int first, int second, int third)
43 {
-> 44 return first + second + third; // Step in targetting complex should stop here
45 }
46
47 int main (int argc, char const *argv[])
llvm-svn: 170008
2012-12-13 03:58:40 +08:00
|
|
|
m_no_more_plans = true;
|
2012-09-07 09:11:44 +08:00
|
|
|
return true;
|
2013-07-19 05:48:26 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-09-07 09:11:44 +08:00
|
|
|
// If we get to this point, we're not going to use a previously set "next
|
|
|
|
// branch" breakpoint, so delete it:
|
2014-03-13 10:47:14 +08:00
|
|
|
ClearNextBranchBreakpoint();
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2014-03-13 10:47:14 +08:00
|
|
|
// We may have set the plan up above in the FrameIsOlder section:
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2014-03-13 10:47:14 +08:00
|
|
|
if (!m_sub_plan_sp)
|
2018-11-15 09:18:15 +08:00
|
|
|
m_sub_plan_sp = m_thread.QueueThreadPlanForStepThrough(
|
|
|
|
m_stack_id, false, stop_others, m_status);
|
2016-09-07 04:57:50 +08:00
|
|
|
|
|
|
|
if (log) {
|
2013-07-19 05:48:26 +08:00
|
|
|
if (m_sub_plan_sp)
|
2019-07-25 01:56:10 +08:00
|
|
|
LLDB_LOGF(log, "Found a step through plan: %s",
|
|
|
|
m_sub_plan_sp->GetName());
|
2016-09-07 04:57:50 +08:00
|
|
|
else
|
2019-07-25 01:56:10 +08:00
|
|
|
LLDB_LOGF(log, "No step through plan found.");
|
2010-11-05 08:18:21 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2018-05-01 00:49:04 +08:00
|
|
|
// If not, give the "should_stop" callback a chance to push a plan to get
|
|
|
|
// us out of here. But only do that if we actually have stepped in.
|
2014-08-06 09:49:59 +08:00
|
|
|
if (!m_sub_plan_sp && frame_order == eFrameCompareYounger)
|
2018-11-15 09:18:15 +08:00
|
|
|
m_sub_plan_sp = CheckShouldStopHereAndQueueStepOut(frame_order, m_status);
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2014-03-13 10:47:14 +08:00
|
|
|
// If we've stepped in and we are going to stop here, check to see if we
|
2018-05-01 00:49:04 +08:00
|
|
|
// were asked to run past the prologue, and if so do that.
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-09-07 09:11:44 +08:00
|
|
|
if (!m_sub_plan_sp && frame_order == eFrameCompareYounger &&
|
|
|
|
m_step_past_prologue) {
|
|
|
|
lldb::StackFrameSP curr_frame = m_thread.GetStackFrameAtIndex(0);
|
|
|
|
if (curr_frame) {
|
|
|
|
size_t bytes_to_skip = 0;
|
|
|
|
lldb::addr_t curr_addr = m_thread.GetRegisterContext()->GetPC();
|
|
|
|
Address func_start_address;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-09-07 09:11:44 +08:00
|
|
|
SymbolContext sc = curr_frame->GetSymbolContext(eSymbolContextFunction |
|
|
|
|
eSymbolContextSymbol);
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-09-07 09:11:44 +08:00
|
|
|
if (sc.function) {
|
|
|
|
func_start_address = sc.function->GetAddressRange().GetBaseAddress();
|
2013-07-19 05:48:26 +08:00
|
|
|
if (curr_addr ==
|
|
|
|
func_start_address.GetLoadAddress(
|
|
|
|
m_thread.CalculateTarget().get()))
|
|
|
|
bytes_to_skip = sc.function->GetPrologueByteSize();
|
|
|
|
} else if (sc.symbol) {
|
|
|
|
func_start_address = sc.symbol->GetAddress();
|
2012-09-07 09:11:44 +08:00
|
|
|
if (curr_addr ==
|
|
|
|
func_start_address.GetLoadAddress(
|
2013-07-19 05:48:26 +08:00
|
|
|
m_thread.CalculateTarget().get()))
|
2012-09-07 09:11:44 +08:00
|
|
|
bytes_to_skip = sc.symbol->GetPrologueByteSize();
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2018-03-13 05:17:04 +08:00
|
|
|
if (bytes_to_skip == 0 && sc.symbol) {
|
|
|
|
TargetSP target = m_thread.CalculateTarget();
|
2018-06-27 15:01:07 +08:00
|
|
|
const Architecture *arch = target->GetArchitecturePlugin();
|
2018-03-13 05:17:04 +08:00
|
|
|
if (arch) {
|
|
|
|
Address curr_sec_addr;
|
|
|
|
target->GetSectionLoadList().ResolveLoadAddress(curr_addr,
|
|
|
|
curr_sec_addr);
|
|
|
|
bytes_to_skip = arch->GetBytesToSkip(*sc.symbol, curr_sec_addr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-09-07 09:11:44 +08:00
|
|
|
if (bytes_to_skip != 0) {
|
|
|
|
func_start_address.Slide(bytes_to_skip);
|
|
|
|
log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP);
|
2019-07-25 01:56:10 +08:00
|
|
|
LLDB_LOGF(log, "Pushing past prologue ");
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2013-07-19 05:48:26 +08:00
|
|
|
m_sub_plan_sp = m_thread.QueueThreadPlanForRunToAddress(
|
2018-11-15 09:18:15 +08:00
|
|
|
false, func_start_address, true, m_status);
|
2010-09-16 08:58:09 +08:00
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2013-07-19 05:48:26 +08:00
|
|
|
if (!m_sub_plan_sp) {
|
2010-06-09 00:52:24 +08:00
|
|
|
m_no_more_plans = true;
|
|
|
|
SetPlanComplete();
|
|
|
|
return true;
|
2016-09-07 04:57:50 +08:00
|
|
|
} else {
|
2010-06-09 00:52:24 +08:00
|
|
|
m_no_more_plans = false;
|
2014-09-30 07:17:18 +08:00
|
|
|
m_sub_plan_sp->SetPrivate(true);
|
2010-06-09 00:52:24 +08:00
|
|
|
return false;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
2010-07-10 10:27:39 +08:00
|
|
|
void ThreadPlanStepInRange::SetAvoidRegexp(const char *name) {
|
2016-09-22 00:01:28 +08:00
|
|
|
auto name_ref = llvm::StringRef::withNullAsEmpty(name);
|
2019-08-20 17:24:20 +08:00
|
|
|
if (m_avoid_regexp_up)
|
|
|
|
*m_avoid_regexp_up = RegularExpression(name_ref);
|
|
|
|
else
|
2019-02-13 14:25:41 +08:00
|
|
|
m_avoid_regexp_up.reset(new RegularExpression(name_ref));
|
2010-07-10 10:27:39 +08:00
|
|
|
}
|
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
void ThreadPlanStepInRange::SetDefaultFlagValue(uint32_t new_value) {
|
|
|
|
// TODO: Should we test this for sanity?
|
|
|
|
ThreadPlanStepInRange::s_default_flag_values = new_value;
|
|
|
|
}
|
|
|
|
|
2014-01-24 05:52:47 +08:00
|
|
|
bool ThreadPlanStepInRange::FrameMatchesAvoidCriteria() {
|
2013-11-04 17:33:30 +08:00
|
|
|
StackFrame *frame = GetThread().GetStackFrameAtIndex(0).get();
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2014-01-24 05:52:47 +08:00
|
|
|
// Check the library list first, as that's cheapest:
|
2014-01-24 05:57:53 +08:00
|
|
|
bool libraries_say_avoid = false;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2014-01-24 05:52:47 +08:00
|
|
|
FileSpecList libraries_to_avoid(GetThread().GetLibrariesToAvoid());
|
|
|
|
size_t num_libraries = libraries_to_avoid.GetSize();
|
2014-01-24 05:57:53 +08:00
|
|
|
if (num_libraries > 0) {
|
|
|
|
SymbolContext sc(frame->GetSymbolContext(eSymbolContextModule));
|
|
|
|
FileSpec frame_library(sc.module_sp->GetFileSpec());
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2014-01-24 05:57:53 +08:00
|
|
|
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;
|
2014-01-24 05:52:47 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2014-01-24 05:52:47 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2014-01-24 05:52:47 +08:00
|
|
|
if (libraries_say_avoid)
|
|
|
|
return true;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2019-02-13 14:25:41 +08:00
|
|
|
const RegularExpression *avoid_regexp_to_use = m_avoid_regexp_up.get();
|
2015-12-15 09:33:19 +08:00
|
|
|
if (avoid_regexp_to_use == nullptr)
|
2010-09-08 11:14:33 +08:00
|
|
|
avoid_regexp_to_use = GetThread().GetSymbolsToAvoidRegexp();
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2015-12-15 09:33:19 +08:00
|
|
|
if (avoid_regexp_to_use != nullptr) {
|
2012-07-13 08:19:40 +08:00
|
|
|
SymbolContext sc = frame->GetSymbolContext(
|
|
|
|
eSymbolContextFunction | eSymbolContextBlock | eSymbolContextSymbol);
|
2015-12-15 09:33:19 +08:00
|
|
|
if (sc.symbol != nullptr) {
|
2015-07-24 16:54:22 +08:00
|
|
|
const char *frame_function_name =
|
|
|
|
sc.GetFunctionName(Mangled::ePreferDemangledWithoutArguments)
|
|
|
|
.GetCString();
|
2012-07-13 08:19:40 +08:00
|
|
|
if (frame_function_name) {
|
2019-08-17 05:25:36 +08:00
|
|
|
llvm::SmallVector<llvm::StringRef, 2> matches;
|
2013-04-04 05:37:16 +08:00
|
|
|
bool return_value =
|
2019-08-17 05:25:36 +08:00
|
|
|
avoid_regexp_to_use->Execute(frame_function_name, &matches);
|
|
|
|
if (return_value && matches.size() > 1) {
|
|
|
|
std::string match = matches[1].str();
|
|
|
|
LLDB_LOGF(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP),
|
|
|
|
"Stepping out of function \"%s\" because it matches "
|
|
|
|
"the avoid regexp \"%s\" - match substring: \"%s\".",
|
|
|
|
frame_function_name,
|
|
|
|
avoid_regexp_to_use->GetText().str().c_str(),
|
|
|
|
match.c_str());
|
2010-07-10 10:27:39 +08:00
|
|
|
}
|
2013-03-15 05:44:36 +08:00
|
|
|
return return_value;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2010-07-10 10:27:39 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2010-07-10 10:27:39 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-03-13 10:47:14 +08:00
|
|
|
bool ThreadPlanStepInRange::DefaultShouldStopHereCallback(
|
|
|
|
ThreadPlan *current_plan, Flags &flags, FrameComparison operation,
|
2018-11-15 09:18:15 +08:00
|
|
|
Status &status, void *baton) {
|
2014-08-08 09:27:01 +08:00
|
|
|
bool should_stop_here = true;
|
2014-03-13 10:47:14 +08:00
|
|
|
StackFrame *frame = current_plan->GetThread().GetStackFrameAtIndex(0).get();
|
Fixed a few bugs in the "step in" thread plan logic.
Added a "step-in-target" flag to "thread step-in" so if you have something like:
Process 28464 stopped
* thread #1: tid = 0x1c03, function: main , stop reason = breakpoint 1.1
frame #0: 0x0000000100000e08 a.out`main at main.c:62
61
-> 62 int A6 = complex (a(4), b(5), c(6)); // Stop here to step targetting b and hitting breakpoint.
63
and you want to get into "complex" skipping a, b and c, you can do:
(lldb) step -t complex
Process 28464 stopped
* thread #1: tid = 0x1c03, function: complex , stop reason = step in
frame #0: 0x0000000100000d0d a.out`complex at main.c:44
41
42 int complex (int first, int second, int third)
43 {
-> 44 return first + second + third; // Step in targetting complex should stop here
45 }
46
47 int main (int argc, char const *argv[])
llvm-svn: 170008
2012-12-13 03:58:40 +08:00
|
|
|
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2013-03-15 05:44:36 +08:00
|
|
|
// First see if the ThreadPlanShouldStopHere default implementation thinks we
|
2014-01-24 05:52:47 +08:00
|
|
|
// should get out of here:
|
2014-03-13 10:47:14 +08:00
|
|
|
should_stop_here = ThreadPlanShouldStopHere::DefaultShouldStopHereCallback(
|
2018-11-15 09:18:15 +08:00
|
|
|
current_plan, flags, operation, status, baton);
|
2014-03-13 10:47:14 +08:00
|
|
|
if (!should_stop_here)
|
|
|
|
return should_stop_here;
|
2012-05-02 02:38:37 +08:00
|
|
|
|
Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value. This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh! I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.
Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming. That allows
us to handle resuming in a more controlled fashion.
Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--
M test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M include/lldb/Target/ThreadList.h
M include/lldb/Target/ThreadPlanStepOut.h
M include/lldb/Target/Thread.h
M include/lldb/Target/ThreadPlanBase.h
M include/lldb/Target/ThreadPlanStepThrough.h
M include/lldb/Target/ThreadPlanStepInstruction.h
M include/lldb/Target/ThreadPlanStepInRange.h
M include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M include/lldb/Target/ThreadPlanStepUntil.h
M include/lldb/Target/StopInfo.h
M include/lldb/Target/Process.h
M include/lldb/Target/ThreadPlanRunToAddress.h
M include/lldb/Target/ThreadPlan.h
M include/lldb/Target/ThreadPlanCallFunction.h
M include/lldb/Target/ThreadPlanStepOverRange.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M source/Target/StopInfo.cpp
M source/Target/Process.cpp
M source/Target/ThreadPlanRunToAddress.cpp
M source/Target/ThreadPlan.cpp
M source/Target/ThreadPlanCallFunction.cpp
M source/Target/ThreadPlanStepOverRange.cpp
M source/Target/ThreadList.cpp
M source/Target/ThreadPlanStepOut.cpp
M source/Target/Thread.cpp
M source/Target/ThreadPlanBase.cpp
M source/Target/ThreadPlanStepThrough.cpp
M source/Target/ThreadPlanStepInstruction.cpp
M source/Target/ThreadPlanStepInRange.cpp
M source/Target/ThreadPlanStepOverBreakpoint.cpp
M source/Target/ThreadPlanStepUntil.cpp
M lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme
llvm-svn: 181381
2013-05-08 08:35:16 +08:00
|
|
|
if (should_stop_here && current_plan->GetKind() == eKindStepInRange &&
|
|
|
|
operation == eFrameCompareYounger) {
|
|
|
|
ThreadPlanStepInRange *step_in_range_plan =
|
|
|
|
static_cast<ThreadPlanStepInRange *>(current_plan);
|
Fixed a few bugs in the "step in" thread plan logic.
Added a "step-in-target" flag to "thread step-in" so if you have something like:
Process 28464 stopped
* thread #1: tid = 0x1c03, function: main , stop reason = breakpoint 1.1
frame #0: 0x0000000100000e08 a.out`main at main.c:62
61
-> 62 int A6 = complex (a(4), b(5), c(6)); // Stop here to step targetting b and hitting breakpoint.
63
and you want to get into "complex" skipping a, b and c, you can do:
(lldb) step -t complex
Process 28464 stopped
* thread #1: tid = 0x1c03, function: complex , stop reason = step in
frame #0: 0x0000000100000d0d a.out`complex at main.c:44
41
42 int complex (int first, int second, int third)
43 {
-> 44 return first + second + third; // Step in targetting complex should stop here
45 }
46
47 int main (int argc, char const *argv[])
llvm-svn: 170008
2012-12-13 03:58:40 +08:00
|
|
|
if (step_in_range_plan->m_step_into_target) {
|
|
|
|
SymbolContext sc = frame->GetSymbolContext(
|
|
|
|
eSymbolContextFunction | eSymbolContextBlock | eSymbolContextSymbol);
|
|
|
|
if (sc.symbol != nullptr) {
|
2018-05-01 00:49:04 +08:00
|
|
|
// First try an exact match, since that's cheap with ConstStrings.
|
|
|
|
// Then do a strstr compare.
|
Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value. This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh! I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.
Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming. That allows
us to handle resuming in a more controlled fashion.
Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--
M test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M include/lldb/Target/ThreadList.h
M include/lldb/Target/ThreadPlanStepOut.h
M include/lldb/Target/Thread.h
M include/lldb/Target/ThreadPlanBase.h
M include/lldb/Target/ThreadPlanStepThrough.h
M include/lldb/Target/ThreadPlanStepInstruction.h
M include/lldb/Target/ThreadPlanStepInRange.h
M include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M include/lldb/Target/ThreadPlanStepUntil.h
M include/lldb/Target/StopInfo.h
M include/lldb/Target/Process.h
M include/lldb/Target/ThreadPlanRunToAddress.h
M include/lldb/Target/ThreadPlan.h
M include/lldb/Target/ThreadPlanCallFunction.h
M include/lldb/Target/ThreadPlanStepOverRange.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M source/Target/StopInfo.cpp
M source/Target/Process.cpp
M source/Target/ThreadPlanRunToAddress.cpp
M source/Target/ThreadPlan.cpp
M source/Target/ThreadPlanCallFunction.cpp
M source/Target/ThreadPlanStepOverRange.cpp
M source/Target/ThreadList.cpp
M source/Target/ThreadPlanStepOut.cpp
M source/Target/Thread.cpp
M source/Target/ThreadPlanBase.cpp
M source/Target/ThreadPlanStepThrough.cpp
M source/Target/ThreadPlanStepInstruction.cpp
M source/Target/ThreadPlanStepInRange.cpp
M source/Target/ThreadPlanStepOverBreakpoint.cpp
M source/Target/ThreadPlanStepUntil.cpp
M lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme
llvm-svn: 181381
2013-05-08 08:35:16 +08:00
|
|
|
if (step_in_range_plan->m_step_into_target == sc.GetFunctionName()) {
|
|
|
|
should_stop_here = true;
|
2015-07-24 03:55:02 +08:00
|
|
|
} else {
|
|
|
|
const char *target_name =
|
|
|
|
step_in_range_plan->m_step_into_target.AsCString();
|
|
|
|
const char *function_name = sc.GetFunctionName().AsCString();
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2015-07-24 03:55:02 +08:00
|
|
|
if (function_name == nullptr)
|
Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value. This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh! I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.
Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming. That allows
us to handle resuming in a more controlled fashion.
Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--
M test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M include/lldb/Target/ThreadList.h
M include/lldb/Target/ThreadPlanStepOut.h
M include/lldb/Target/Thread.h
M include/lldb/Target/ThreadPlanBase.h
M include/lldb/Target/ThreadPlanStepThrough.h
M include/lldb/Target/ThreadPlanStepInstruction.h
M include/lldb/Target/ThreadPlanStepInRange.h
M include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M include/lldb/Target/ThreadPlanStepUntil.h
M include/lldb/Target/StopInfo.h
M include/lldb/Target/Process.h
M include/lldb/Target/ThreadPlanRunToAddress.h
M include/lldb/Target/ThreadPlan.h
M include/lldb/Target/ThreadPlanCallFunction.h
M include/lldb/Target/ThreadPlanStepOverRange.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M source/Target/StopInfo.cpp
M source/Target/Process.cpp
M source/Target/ThreadPlanRunToAddress.cpp
M source/Target/ThreadPlan.cpp
M source/Target/ThreadPlanCallFunction.cpp
M source/Target/ThreadPlanStepOverRange.cpp
M source/Target/ThreadList.cpp
M source/Target/ThreadPlanStepOut.cpp
M source/Target/Thread.cpp
M source/Target/ThreadPlanBase.cpp
M source/Target/ThreadPlanStepThrough.cpp
M source/Target/ThreadPlanStepInstruction.cpp
M source/Target/ThreadPlanStepInRange.cpp
M source/Target/ThreadPlanStepOverBreakpoint.cpp
M source/Target/ThreadPlanStepUntil.cpp
M lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme
llvm-svn: 181381
2013-05-08 08:35:16 +08:00
|
|
|
should_stop_here = false;
|
2015-07-24 03:55:02 +08:00
|
|
|
else if (strstr(function_name, target_name) == nullptr)
|
Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value. This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh! I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.
Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming. That allows
us to handle resuming in a more controlled fashion.
Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--
M test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M include/lldb/Target/ThreadList.h
M include/lldb/Target/ThreadPlanStepOut.h
M include/lldb/Target/Thread.h
M include/lldb/Target/ThreadPlanBase.h
M include/lldb/Target/ThreadPlanStepThrough.h
M include/lldb/Target/ThreadPlanStepInstruction.h
M include/lldb/Target/ThreadPlanStepInRange.h
M include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M include/lldb/Target/ThreadPlanStepUntil.h
M include/lldb/Target/StopInfo.h
M include/lldb/Target/Process.h
M include/lldb/Target/ThreadPlanRunToAddress.h
M include/lldb/Target/ThreadPlan.h
M include/lldb/Target/ThreadPlanCallFunction.h
M include/lldb/Target/ThreadPlanStepOverRange.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M source/Target/StopInfo.cpp
M source/Target/Process.cpp
M source/Target/ThreadPlanRunToAddress.cpp
M source/Target/ThreadPlan.cpp
M source/Target/ThreadPlanCallFunction.cpp
M source/Target/ThreadPlanStepOverRange.cpp
M source/Target/ThreadList.cpp
M source/Target/ThreadPlanStepOut.cpp
M source/Target/Thread.cpp
M source/Target/ThreadPlanBase.cpp
M source/Target/ThreadPlanStepThrough.cpp
M source/Target/ThreadPlanStepInstruction.cpp
M source/Target/ThreadPlanStepInRange.cpp
M source/Target/ThreadPlanStepOverBreakpoint.cpp
M source/Target/ThreadPlanStepUntil.cpp
M lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme
llvm-svn: 181381
2013-05-08 08:35:16 +08:00
|
|
|
should_stop_here = false;
|
2012-05-02 02:38:37 +08:00
|
|
|
}
|
Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value. This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh! I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.
Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming. That allows
us to handle resuming in a more controlled fashion.
Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--
M test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M include/lldb/Target/ThreadList.h
M include/lldb/Target/ThreadPlanStepOut.h
M include/lldb/Target/Thread.h
M include/lldb/Target/ThreadPlanBase.h
M include/lldb/Target/ThreadPlanStepThrough.h
M include/lldb/Target/ThreadPlanStepInstruction.h
M include/lldb/Target/ThreadPlanStepInRange.h
M include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M include/lldb/Target/ThreadPlanStepUntil.h
M include/lldb/Target/StopInfo.h
M include/lldb/Target/Process.h
M include/lldb/Target/ThreadPlanRunToAddress.h
M include/lldb/Target/ThreadPlan.h
M include/lldb/Target/ThreadPlanCallFunction.h
M include/lldb/Target/ThreadPlanStepOverRange.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M source/Target/StopInfo.cpp
M source/Target/Process.cpp
M source/Target/ThreadPlanRunToAddress.cpp
M source/Target/ThreadPlan.cpp
M source/Target/ThreadPlanCallFunction.cpp
M source/Target/ThreadPlanStepOverRange.cpp
M source/Target/ThreadList.cpp
M source/Target/ThreadPlanStepOut.cpp
M source/Target/Thread.cpp
M source/Target/ThreadPlanBase.cpp
M source/Target/ThreadPlanStepThrough.cpp
M source/Target/ThreadPlanStepInstruction.cpp
M source/Target/ThreadPlanStepInRange.cpp
M source/Target/ThreadPlanStepOverBreakpoint.cpp
M source/Target/ThreadPlanStepUntil.cpp
M lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme
llvm-svn: 181381
2013-05-08 08:35:16 +08:00
|
|
|
if (log && !should_stop_here)
|
2019-07-25 01:56:10 +08:00
|
|
|
LLDB_LOGF(log,
|
|
|
|
"Stepping out of frame %s which did not match step into "
|
|
|
|
"target %s.",
|
|
|
|
sc.GetFunctionName().AsCString(),
|
|
|
|
step_in_range_plan->m_step_into_target.AsCString());
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2012-05-02 02:38:37 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2014-03-13 10:47:14 +08:00
|
|
|
if (should_stop_here) {
|
Fixed a few bugs in the "step in" thread plan logic.
Added a "step-in-target" flag to "thread step-in" so if you have something like:
Process 28464 stopped
* thread #1: tid = 0x1c03, function: main , stop reason = breakpoint 1.1
frame #0: 0x0000000100000e08 a.out`main at main.c:62
61
-> 62 int A6 = complex (a(4), b(5), c(6)); // Stop here to step targetting b and hitting breakpoint.
63
and you want to get into "complex" skipping a, b and c, you can do:
(lldb) step -t complex
Process 28464 stopped
* thread #1: tid = 0x1c03, function: complex , stop reason = step in
frame #0: 0x0000000100000d0d a.out`complex at main.c:44
41
42 int complex (int first, int second, int third)
43 {
-> 44 return first + second + third; // Step in targetting complex should stop here
45 }
46
47 int main (int argc, char const *argv[])
llvm-svn: 170008
2012-12-13 03:58:40 +08:00
|
|
|
ThreadPlanStepInRange *step_in_range_plan =
|
Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value. This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh! I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.
Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming. That allows
us to handle resuming in a more controlled fashion.
Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--
M test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M include/lldb/Target/ThreadList.h
M include/lldb/Target/ThreadPlanStepOut.h
M include/lldb/Target/Thread.h
M include/lldb/Target/ThreadPlanBase.h
M include/lldb/Target/ThreadPlanStepThrough.h
M include/lldb/Target/ThreadPlanStepInstruction.h
M include/lldb/Target/ThreadPlanStepInRange.h
M include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M include/lldb/Target/ThreadPlanStepUntil.h
M include/lldb/Target/StopInfo.h
M include/lldb/Target/Process.h
M include/lldb/Target/ThreadPlanRunToAddress.h
M include/lldb/Target/ThreadPlan.h
M include/lldb/Target/ThreadPlanCallFunction.h
M include/lldb/Target/ThreadPlanStepOverRange.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M source/Target/StopInfo.cpp
M source/Target/Process.cpp
M source/Target/ThreadPlanRunToAddress.cpp
M source/Target/ThreadPlan.cpp
M source/Target/ThreadPlanCallFunction.cpp
M source/Target/ThreadPlanStepOverRange.cpp
M source/Target/ThreadList.cpp
M source/Target/ThreadPlanStepOut.cpp
M source/Target/Thread.cpp
M source/Target/ThreadPlanBase.cpp
M source/Target/ThreadPlanStepThrough.cpp
M source/Target/ThreadPlanStepInstruction.cpp
M source/Target/ThreadPlanStepInRange.cpp
M source/Target/ThreadPlanStepOverBreakpoint.cpp
M source/Target/ThreadPlanStepUntil.cpp
M lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme
llvm-svn: 181381
2013-05-08 08:35:16 +08:00
|
|
|
static_cast<ThreadPlanStepInRange *>(current_plan);
|
2014-01-24 05:52:47 +08:00
|
|
|
// Don't log the should_step_out here, it's easier to do it in
|
|
|
|
// FrameMatchesAvoidCriteria.
|
Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value. This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh! I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.
Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming. That allows
us to handle resuming in a more controlled fashion.
Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--
M test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M include/lldb/Target/ThreadList.h
M include/lldb/Target/ThreadPlanStepOut.h
M include/lldb/Target/Thread.h
M include/lldb/Target/ThreadPlanBase.h
M include/lldb/Target/ThreadPlanStepThrough.h
M include/lldb/Target/ThreadPlanStepInstruction.h
M include/lldb/Target/ThreadPlanStepInRange.h
M include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M include/lldb/Target/ThreadPlanStepUntil.h
M include/lldb/Target/StopInfo.h
M include/lldb/Target/Process.h
M include/lldb/Target/ThreadPlanRunToAddress.h
M include/lldb/Target/ThreadPlan.h
M include/lldb/Target/ThreadPlanCallFunction.h
M include/lldb/Target/ThreadPlanStepOverRange.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M source/Target/StopInfo.cpp
M source/Target/Process.cpp
M source/Target/ThreadPlanRunToAddress.cpp
M source/Target/ThreadPlan.cpp
M source/Target/ThreadPlanCallFunction.cpp
M source/Target/ThreadPlanStepOverRange.cpp
M source/Target/ThreadList.cpp
M source/Target/ThreadPlanStepOut.cpp
M source/Target/Thread.cpp
M source/Target/ThreadPlanBase.cpp
M source/Target/ThreadPlanStepThrough.cpp
M source/Target/ThreadPlanStepInstruction.cpp
M source/Target/ThreadPlanStepInRange.cpp
M source/Target/ThreadPlanStepOverBreakpoint.cpp
M source/Target/ThreadPlanStepUntil.cpp
M lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme
llvm-svn: 181381
2013-05-08 08:35:16 +08:00
|
|
|
should_stop_here = !step_in_range_plan->FrameMatchesAvoidCriteria();
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value. This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh! I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.
Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming. That allows
us to handle resuming in a more controlled fashion.
Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--
M test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M include/lldb/Target/ThreadList.h
M include/lldb/Target/ThreadPlanStepOut.h
M include/lldb/Target/Thread.h
M include/lldb/Target/ThreadPlanBase.h
M include/lldb/Target/ThreadPlanStepThrough.h
M include/lldb/Target/ThreadPlanStepInstruction.h
M include/lldb/Target/ThreadPlanStepInRange.h
M include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M include/lldb/Target/ThreadPlanStepUntil.h
M include/lldb/Target/StopInfo.h
M include/lldb/Target/Process.h
M include/lldb/Target/ThreadPlanRunToAddress.h
M include/lldb/Target/ThreadPlan.h
M include/lldb/Target/ThreadPlanCallFunction.h
M include/lldb/Target/ThreadPlanStepOverRange.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M source/Target/StopInfo.cpp
M source/Target/Process.cpp
M source/Target/ThreadPlanRunToAddress.cpp
M source/Target/ThreadPlan.cpp
M source/Target/ThreadPlanCallFunction.cpp
M source/Target/ThreadPlanStepOverRange.cpp
M source/Target/ThreadList.cpp
M source/Target/ThreadPlanStepOut.cpp
M source/Target/Thread.cpp
M source/Target/ThreadPlanBase.cpp
M source/Target/ThreadPlanStepThrough.cpp
M source/Target/ThreadPlanStepInstruction.cpp
M source/Target/ThreadPlanStepInRange.cpp
M source/Target/ThreadPlanStepOverBreakpoint.cpp
M source/Target/ThreadPlanStepUntil.cpp
M lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme
llvm-svn: 181381
2013-05-08 08:35:16 +08:00
|
|
|
return should_stop_here;
|
2012-05-02 02:38:37 +08:00
|
|
|
}
|
2012-09-01 09:02:41 +08:00
|
|
|
|
Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value. This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh! I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.
Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming. That allows
us to handle resuming in a more controlled fashion.
Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--
M test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M include/lldb/Target/ThreadList.h
M include/lldb/Target/ThreadPlanStepOut.h
M include/lldb/Target/Thread.h
M include/lldb/Target/ThreadPlanBase.h
M include/lldb/Target/ThreadPlanStepThrough.h
M include/lldb/Target/ThreadPlanStepInstruction.h
M include/lldb/Target/ThreadPlanStepInRange.h
M include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M include/lldb/Target/ThreadPlanStepUntil.h
M include/lldb/Target/StopInfo.h
M include/lldb/Target/Process.h
M include/lldb/Target/ThreadPlanRunToAddress.h
M include/lldb/Target/ThreadPlan.h
M include/lldb/Target/ThreadPlanCallFunction.h
M include/lldb/Target/ThreadPlanStepOverRange.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M source/Target/StopInfo.cpp
M source/Target/Process.cpp
M source/Target/ThreadPlanRunToAddress.cpp
M source/Target/ThreadPlan.cpp
M source/Target/ThreadPlanCallFunction.cpp
M source/Target/ThreadPlanStepOverRange.cpp
M source/Target/ThreadList.cpp
M source/Target/ThreadPlanStepOut.cpp
M source/Target/Thread.cpp
M source/Target/ThreadPlanBase.cpp
M source/Target/ThreadPlanStepThrough.cpp
M source/Target/ThreadPlanStepInstruction.cpp
M source/Target/ThreadPlanStepInRange.cpp
M source/Target/ThreadPlanStepOverBreakpoint.cpp
M source/Target/ThreadPlanStepUntil.cpp
M lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme
llvm-svn: 181381
2013-05-08 08:35:16 +08:00
|
|
|
bool ThreadPlanStepInRange::DoPlanExplainsStop(Event *event_ptr) {
|
2012-09-01 09:02:41 +08:00
|
|
|
// We always explain a stop. Either we've just done a single step, in which
|
2018-05-01 00:49:04 +08:00
|
|
|
// case we'll do our ordinary processing, or we stopped for some reason that
|
|
|
|
// isn't handled by our sub-plans, in which case we want to just stop right
|
|
|
|
// away. In general, we don't want to mark the plan as complete for
|
|
|
|
// unexplained stops. For instance, if you step in to some code with no debug
|
|
|
|
// info, so you step out and in the course of that hit a breakpoint, then you
|
|
|
|
// want to stop & show the user the breakpoint, but not unship the step in
|
|
|
|
// plan, since you still may want to complete that plan when you continue.
|
|
|
|
// This is particularly true when doing "step in to target function."
|
2012-09-07 09:11:44 +08:00
|
|
|
// stepping.
|
2016-09-07 04:57:50 +08:00
|
|
|
//
|
2018-05-01 00:49:04 +08:00
|
|
|
// The only variation is that if we are doing "step by running to next
|
|
|
|
// branch" in which case if we hit our branch breakpoint we don't set the
|
|
|
|
// plan to complete.
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-09-07 09:11:44 +08:00
|
|
|
bool return_value = false;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-09-07 09:11:44 +08:00
|
|
|
if (m_virtual_step) {
|
Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value. This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh! I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.
Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming. That allows
us to handle resuming in a more controlled fashion.
Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--
M test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M include/lldb/Target/ThreadList.h
M include/lldb/Target/ThreadPlanStepOut.h
M include/lldb/Target/Thread.h
M include/lldb/Target/ThreadPlanBase.h
M include/lldb/Target/ThreadPlanStepThrough.h
M include/lldb/Target/ThreadPlanStepInstruction.h
M include/lldb/Target/ThreadPlanStepInRange.h
M include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M include/lldb/Target/ThreadPlanStepUntil.h
M include/lldb/Target/StopInfo.h
M include/lldb/Target/Process.h
M include/lldb/Target/ThreadPlanRunToAddress.h
M include/lldb/Target/ThreadPlan.h
M include/lldb/Target/ThreadPlanCallFunction.h
M include/lldb/Target/ThreadPlanStepOverRange.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M source/Target/StopInfo.cpp
M source/Target/Process.cpp
M source/Target/ThreadPlanRunToAddress.cpp
M source/Target/ThreadPlan.cpp
M source/Target/ThreadPlanCallFunction.cpp
M source/Target/ThreadPlanStepOverRange.cpp
M source/Target/ThreadList.cpp
M source/Target/ThreadPlanStepOut.cpp
M source/Target/Thread.cpp
M source/Target/ThreadPlanBase.cpp
M source/Target/ThreadPlanStepThrough.cpp
M source/Target/ThreadPlanStepInstruction.cpp
M source/Target/ThreadPlanStepInRange.cpp
M source/Target/ThreadPlanStepOverBreakpoint.cpp
M source/Target/ThreadPlanStepUntil.cpp
M lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme
llvm-svn: 181381
2013-05-08 08:35:16 +08:00
|
|
|
return_value = true;
|
2016-09-07 04:57:50 +08:00
|
|
|
} else {
|
2012-09-07 09:11:44 +08:00
|
|
|
StopInfoSP stop_info_sp = GetPrivateStopInfo();
|
Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value. This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh! I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.
Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming. That allows
us to handle resuming in a more controlled fashion.
Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--
M test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M include/lldb/Target/ThreadList.h
M include/lldb/Target/ThreadPlanStepOut.h
M include/lldb/Target/Thread.h
M include/lldb/Target/ThreadPlanBase.h
M include/lldb/Target/ThreadPlanStepThrough.h
M include/lldb/Target/ThreadPlanStepInstruction.h
M include/lldb/Target/ThreadPlanStepInRange.h
M include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M include/lldb/Target/ThreadPlanStepUntil.h
M include/lldb/Target/StopInfo.h
M include/lldb/Target/Process.h
M include/lldb/Target/ThreadPlanRunToAddress.h
M include/lldb/Target/ThreadPlan.h
M include/lldb/Target/ThreadPlanCallFunction.h
M include/lldb/Target/ThreadPlanStepOverRange.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M source/Target/StopInfo.cpp
M source/Target/Process.cpp
M source/Target/ThreadPlanRunToAddress.cpp
M source/Target/ThreadPlan.cpp
M source/Target/ThreadPlanCallFunction.cpp
M source/Target/ThreadPlanStepOverRange.cpp
M source/Target/ThreadList.cpp
M source/Target/ThreadPlanStepOut.cpp
M source/Target/Thread.cpp
M source/Target/ThreadPlanBase.cpp
M source/Target/ThreadPlanStepThrough.cpp
M source/Target/ThreadPlanStepInstruction.cpp
M source/Target/ThreadPlanStepInRange.cpp
M source/Target/ThreadPlanStepOverBreakpoint.cpp
M source/Target/ThreadPlanStepUntil.cpp
M lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme
llvm-svn: 181381
2013-05-08 08:35:16 +08:00
|
|
|
if (stop_info_sp) {
|
|
|
|
StopReason reason = stop_info_sp->GetStopReason();
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2015-07-24 03:55:02 +08:00
|
|
|
if (reason == eStopReasonBreakpoint) {
|
Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value. This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh! I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.
Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming. That allows
us to handle resuming in a more controlled fashion.
Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--
M test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M include/lldb/Target/ThreadList.h
M include/lldb/Target/ThreadPlanStepOut.h
M include/lldb/Target/Thread.h
M include/lldb/Target/ThreadPlanBase.h
M include/lldb/Target/ThreadPlanStepThrough.h
M include/lldb/Target/ThreadPlanStepInstruction.h
M include/lldb/Target/ThreadPlanStepInRange.h
M include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M include/lldb/Target/ThreadPlanStepUntil.h
M include/lldb/Target/StopInfo.h
M include/lldb/Target/Process.h
M include/lldb/Target/ThreadPlanRunToAddress.h
M include/lldb/Target/ThreadPlan.h
M include/lldb/Target/ThreadPlanCallFunction.h
M include/lldb/Target/ThreadPlanStepOverRange.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M source/Target/StopInfo.cpp
M source/Target/Process.cpp
M source/Target/ThreadPlanRunToAddress.cpp
M source/Target/ThreadPlan.cpp
M source/Target/ThreadPlanCallFunction.cpp
M source/Target/ThreadPlanStepOverRange.cpp
M source/Target/ThreadList.cpp
M source/Target/ThreadPlanStepOut.cpp
M source/Target/Thread.cpp
M source/Target/ThreadPlanBase.cpp
M source/Target/ThreadPlanStepThrough.cpp
M source/Target/ThreadPlanStepInstruction.cpp
M source/Target/ThreadPlanStepInRange.cpp
M source/Target/ThreadPlanStepOverBreakpoint.cpp
M source/Target/ThreadPlanStepUntil.cpp
M lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme
llvm-svn: 181381
2013-05-08 08:35:16 +08:00
|
|
|
if (NextRangeBreakpointExplainsStop(stop_info_sp)) {
|
2012-09-07 09:11:44 +08:00
|
|
|
return_value = true;
|
2012-09-01 09:02:41 +08:00
|
|
|
}
|
|
|
|
} else if (IsUsuallyUnexplainedStopReason(reason)) {
|
|
|
|
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
|
2016-09-07 04:57:50 +08:00
|
|
|
if (log)
|
2012-09-01 09:02:41 +08:00
|
|
|
log->PutCString("ThreadPlanStepInRange got asked if it explains the "
|
|
|
|
"stop for some reason other than step.");
|
|
|
|
return_value = false;
|
|
|
|
} else {
|
Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value. This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh! I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.
Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming. That allows
us to handle resuming in a more controlled fashion.
Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--
M test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M include/lldb/Target/ThreadList.h
M include/lldb/Target/ThreadPlanStepOut.h
M include/lldb/Target/Thread.h
M include/lldb/Target/ThreadPlanBase.h
M include/lldb/Target/ThreadPlanStepThrough.h
M include/lldb/Target/ThreadPlanStepInstruction.h
M include/lldb/Target/ThreadPlanStepInRange.h
M include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M include/lldb/Target/ThreadPlanStepUntil.h
M include/lldb/Target/StopInfo.h
M include/lldb/Target/Process.h
M include/lldb/Target/ThreadPlanRunToAddress.h
M include/lldb/Target/ThreadPlan.h
M include/lldb/Target/ThreadPlanCallFunction.h
M include/lldb/Target/ThreadPlanStepOverRange.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M source/Target/StopInfo.cpp
M source/Target/Process.cpp
M source/Target/ThreadPlanRunToAddress.cpp
M source/Target/ThreadPlan.cpp
M source/Target/ThreadPlanCallFunction.cpp
M source/Target/ThreadPlanStepOverRange.cpp
M source/Target/ThreadList.cpp
M source/Target/ThreadPlanStepOut.cpp
M source/Target/Thread.cpp
M source/Target/ThreadPlanBase.cpp
M source/Target/ThreadPlanStepThrough.cpp
M source/Target/ThreadPlanStepInstruction.cpp
M source/Target/ThreadPlanStepInRange.cpp
M source/Target/ThreadPlanStepOverBreakpoint.cpp
M source/Target/ThreadPlanStepUntil.cpp
M lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme
llvm-svn: 181381
2013-05-08 08:35:16 +08:00
|
|
|
return_value = true;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
} else
|
Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value. This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh! I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.
Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming. That allows
us to handle resuming in a more controlled fashion.
Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--
M test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M include/lldb/Target/ThreadList.h
M include/lldb/Target/ThreadPlanStepOut.h
M include/lldb/Target/Thread.h
M include/lldb/Target/ThreadPlanBase.h
M include/lldb/Target/ThreadPlanStepThrough.h
M include/lldb/Target/ThreadPlanStepInstruction.h
M include/lldb/Target/ThreadPlanStepInRange.h
M include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M include/lldb/Target/ThreadPlanStepUntil.h
M include/lldb/Target/StopInfo.h
M include/lldb/Target/Process.h
M include/lldb/Target/ThreadPlanRunToAddress.h
M include/lldb/Target/ThreadPlan.h
M include/lldb/Target/ThreadPlanCallFunction.h
M include/lldb/Target/ThreadPlanStepOverRange.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M source/Target/StopInfo.cpp
M source/Target/Process.cpp
M source/Target/ThreadPlanRunToAddress.cpp
M source/Target/ThreadPlan.cpp
M source/Target/ThreadPlanCallFunction.cpp
M source/Target/ThreadPlanStepOverRange.cpp
M source/Target/ThreadList.cpp
M source/Target/ThreadPlanStepOut.cpp
M source/Target/Thread.cpp
M source/Target/ThreadPlanBase.cpp
M source/Target/ThreadPlanStepThrough.cpp
M source/Target/ThreadPlanStepInstruction.cpp
M source/Target/ThreadPlanStepInRange.cpp
M source/Target/ThreadPlanStepOverBreakpoint.cpp
M source/Target/ThreadPlanStepUntil.cpp
M lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme
llvm-svn: 181381
2013-05-08 08:35:16 +08:00
|
|
|
return_value = true;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value. This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh! I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.
Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming. That allows
us to handle resuming in a more controlled fashion.
Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--
M test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M include/lldb/Target/ThreadList.h
M include/lldb/Target/ThreadPlanStepOut.h
M include/lldb/Target/Thread.h
M include/lldb/Target/ThreadPlanBase.h
M include/lldb/Target/ThreadPlanStepThrough.h
M include/lldb/Target/ThreadPlanStepInstruction.h
M include/lldb/Target/ThreadPlanStepInRange.h
M include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M include/lldb/Target/ThreadPlanStepUntil.h
M include/lldb/Target/StopInfo.h
M include/lldb/Target/Process.h
M include/lldb/Target/ThreadPlanRunToAddress.h
M include/lldb/Target/ThreadPlan.h
M include/lldb/Target/ThreadPlanCallFunction.h
M include/lldb/Target/ThreadPlanStepOverRange.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M source/Target/StopInfo.cpp
M source/Target/Process.cpp
M source/Target/ThreadPlanRunToAddress.cpp
M source/Target/ThreadPlan.cpp
M source/Target/ThreadPlanCallFunction.cpp
M source/Target/ThreadPlanStepOverRange.cpp
M source/Target/ThreadList.cpp
M source/Target/ThreadPlanStepOut.cpp
M source/Target/Thread.cpp
M source/Target/ThreadPlanBase.cpp
M source/Target/ThreadPlanStepThrough.cpp
M source/Target/ThreadPlanStepInstruction.cpp
M source/Target/ThreadPlanStepInRange.cpp
M source/Target/ThreadPlanStepOverBreakpoint.cpp
M source/Target/ThreadPlanStepUntil.cpp
M lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme
llvm-svn: 181381
2013-05-08 08:35:16 +08:00
|
|
|
return return_value;
|
2012-09-01 09:02:41 +08:00
|
|
|
}
|
2013-05-14 23:20:12 +08:00
|
|
|
|
|
|
|
bool ThreadPlanStepInRange::DoWillResume(lldb::StateType resume_state,
|
|
|
|
bool current_plan) {
|
|
|
|
m_virtual_step = false;
|
2012-09-01 09:02:41 +08:00
|
|
|
if (resume_state == eStateStepping && current_plan) {
|
2012-09-07 09:11:44 +08:00
|
|
|
// See if we are about to step over a virtual inlined call.
|
2013-05-14 23:20:12 +08:00
|
|
|
bool step_without_resume = m_thread.DecrementCurrentInlinedDepth();
|
|
|
|
if (step_without_resume) {
|
2013-03-28 07:08:40 +08:00
|
|
|
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
|
2019-07-25 01:56:10 +08:00
|
|
|
LLDB_LOGF(log,
|
|
|
|
"ThreadPlanStepInRange::DoWillResume: returning false, "
|
|
|
|
"inline_depth: %d",
|
|
|
|
m_thread.GetCurrentInlinedDepth());
|
2012-09-01 09:02:41 +08:00
|
|
|
SetStopInfo(StopInfo::CreateStopReasonToTrace(m_thread));
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-09-07 09:11:44 +08:00
|
|
|
// FIXME: Maybe it would be better to create a InlineStep stop reason, but
|
2015-12-15 09:33:19 +08:00
|
|
|
// then
|
2012-05-02 02:38:37 +08:00
|
|
|
// the whole rest of the world would have to handle that stop reason.
|
2015-12-15 09:33:19 +08:00
|
|
|
m_virtual_step = true;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2012-09-01 09:02:41 +08:00
|
|
|
return !step_without_resume;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
return true;
|
2013-05-14 23:20:12 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2013-03-15 05:44:36 +08:00
|
|
|
bool ThreadPlanStepInRange::IsVirtualStep() { return m_virtual_step; }
|