130fdc8d8SChris Lattner //===-- ThreadPlanStepOverRange.cpp -----------------------------*- C++ -*-===//
230fdc8d8SChris Lattner //
330fdc8d8SChris Lattner //                     The LLVM Compiler Infrastructure
430fdc8d8SChris Lattner //
530fdc8d8SChris Lattner // This file is distributed under the University of Illinois Open Source
630fdc8d8SChris Lattner // License. See LICENSE.TXT for details.
730fdc8d8SChris Lattner //
830fdc8d8SChris Lattner //===----------------------------------------------------------------------===//
930fdc8d8SChris Lattner 
1030fdc8d8SChris Lattner #include "lldb/Target/ThreadPlanStepOverRange.h"
1130fdc8d8SChris Lattner 
1230fdc8d8SChris Lattner // C Includes
1330fdc8d8SChris Lattner // C++ Includes
1430fdc8d8SChris Lattner // Other libraries and framework includes
1530fdc8d8SChris Lattner // Project includes
1630fdc8d8SChris Lattner 
1730fdc8d8SChris Lattner #include "lldb/lldb-private-log.h"
1830fdc8d8SChris Lattner #include "lldb/Core/Log.h"
1930fdc8d8SChris Lattner #include "lldb/Core/Stream.h"
20513c6bb8SJim Ingham #include "lldb/Symbol/Block.h"
21*3bfa753fSJim Ingham #include "lldb/Symbol/CompileUnit.h"
22513c6bb8SJim Ingham #include "lldb/Symbol/Function.h"
23*3bfa753fSJim Ingham #include "lldb/Symbol/LineTable.h"
2430fdc8d8SChris Lattner #include "lldb/Target/Process.h"
2530fdc8d8SChris Lattner #include "lldb/Target/RegisterContext.h"
26514487e8SGreg Clayton #include "lldb/Target/Target.h"
2730fdc8d8SChris Lattner #include "lldb/Target/Thread.h"
2830fdc8d8SChris Lattner #include "lldb/Target/ThreadPlanStepOut.h"
2930fdc8d8SChris Lattner #include "lldb/Target/ThreadPlanStepThrough.h"
3030fdc8d8SChris Lattner 
3130fdc8d8SChris Lattner using namespace lldb_private;
322d4edfbcSGreg Clayton using namespace lldb;
3330fdc8d8SChris Lattner 
3430fdc8d8SChris Lattner 
3530fdc8d8SChris Lattner //----------------------------------------------------------------------
3630fdc8d8SChris Lattner // ThreadPlanStepOverRange: Step through a stack range, either stepping over or into
3730fdc8d8SChris Lattner // based on the value of \a type.
3830fdc8d8SChris Lattner //----------------------------------------------------------------------
3930fdc8d8SChris Lattner 
4030fdc8d8SChris Lattner ThreadPlanStepOverRange::ThreadPlanStepOverRange
4130fdc8d8SChris Lattner (
4230fdc8d8SChris Lattner     Thread &thread,
4330fdc8d8SChris Lattner     const AddressRange &range,
4430fdc8d8SChris Lattner     const SymbolContext &addr_context,
4564e7ead1SJim Ingham     lldb::RunMode stop_others
4630fdc8d8SChris Lattner ) :
47513c6bb8SJim Ingham     ThreadPlanStepRange (ThreadPlan::eKindStepOverRange, "Step range stepping over", thread, range, addr_context, stop_others),
48513c6bb8SJim Ingham     m_first_resume(true)
4930fdc8d8SChris Lattner {
5030fdc8d8SChris Lattner }
5130fdc8d8SChris Lattner 
5230fdc8d8SChris Lattner ThreadPlanStepOverRange::~ThreadPlanStepOverRange ()
5330fdc8d8SChris Lattner {
5430fdc8d8SChris Lattner }
5530fdc8d8SChris Lattner 
5630fdc8d8SChris Lattner void
5730fdc8d8SChris Lattner ThreadPlanStepOverRange::GetDescription (Stream *s, lldb::DescriptionLevel level)
5830fdc8d8SChris Lattner {
5930fdc8d8SChris Lattner     if (level == lldb::eDescriptionLevelBrief)
6030fdc8d8SChris Lattner         s->Printf("step over");
6130fdc8d8SChris Lattner     else
6230fdc8d8SChris Lattner     {
6330fdc8d8SChris Lattner         s->Printf ("stepping through range (stepping over functions): ");
64c4c9fedcSJim Ingham         DumpRanges(s);
6530fdc8d8SChris Lattner     }
6630fdc8d8SChris Lattner }
6730fdc8d8SChris Lattner 
6830fdc8d8SChris Lattner bool
6930fdc8d8SChris Lattner ThreadPlanStepOverRange::ShouldStop (Event *event_ptr)
7030fdc8d8SChris Lattner {
712d4edfbcSGreg Clayton     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
7230fdc8d8SChris Lattner 
7330fdc8d8SChris Lattner     if (log)
7430fdc8d8SChris Lattner     {
7530fdc8d8SChris Lattner         StreamString s;
76514487e8SGreg Clayton         s.Address (m_thread.GetRegisterContext()->GetPC(),
771ac04c30SGreg Clayton                    m_thread.CalculateTarget()->GetArchitecture().GetAddressByteSize());
7830fdc8d8SChris Lattner         log->Printf("ThreadPlanStepOverRange reached %s.", s.GetData());
7930fdc8d8SChris Lattner     }
8030fdc8d8SChris Lattner 
8130fdc8d8SChris Lattner     // If we're out of the range but in the same frame or in our caller's frame
8230fdc8d8SChris Lattner     // then we should stop.
834a58e968SJim Ingham     // When stepping out we only stop others if we are forcing running one thread.
8430fdc8d8SChris Lattner     bool stop_others;
8530fdc8d8SChris Lattner     if (m_stop_others == lldb::eOnlyThisThread)
8630fdc8d8SChris Lattner         stop_others = true;
8730fdc8d8SChris Lattner     else
8830fdc8d8SChris Lattner         stop_others = false;
8930fdc8d8SChris Lattner 
9030fdc8d8SChris Lattner     ThreadPlan* new_plan = NULL;
9130fdc8d8SChris Lattner 
92b5c0d1ccSJim Ingham     FrameComparison frame_order = CompareCurrentFrameToStartFrame();
93b5c0d1ccSJim Ingham 
94b5c0d1ccSJim Ingham     if (frame_order == eFrameCompareOlder)
955822173bSJim Ingham     {
965822173bSJim Ingham         // If we're in an older frame then we should stop.
975822173bSJim Ingham         //
985822173bSJim Ingham         // A caveat to this is if we think the frame is older but we're actually in a trampoline.
995822173bSJim Ingham         // I'm going to make the assumption that you wouldn't RETURN to a trampoline.  So if we are
1005822173bSJim Ingham         // in a trampoline we think the frame is older because the trampoline confused the backtracer.
1015822173bSJim Ingham         // As below, we step through first, and then try to figure out how to get back out again.
1025822173bSJim Ingham 
10318de2fdcSJim Ingham         new_plan = m_thread.QueueThreadPlanForStepThrough (m_stack_id, false, stop_others);
1045822173bSJim Ingham 
1055822173bSJim Ingham         if (new_plan != NULL && log)
1065822173bSJim Ingham             log->Printf("Thought I stepped out, but in fact arrived at a trampoline.");
1075822173bSJim Ingham     }
108b5c0d1ccSJim Ingham     else if (frame_order == eFrameCompareYounger)
109b5c0d1ccSJim Ingham     {
110b5c0d1ccSJim Ingham         // Make sure we really are in a new frame.  Do that by unwinding and seeing if the
111b5c0d1ccSJim Ingham         // start function really is our start function...
112b5c0d1ccSJim Ingham         StackFrameSP older_frame_sp = m_thread.GetStackFrameAtIndex(1);
113b5c0d1ccSJim Ingham 
114b5c0d1ccSJim Ingham         // But if we can't even unwind one frame we should just get out of here & stop...
115b5c0d1ccSJim Ingham         if (older_frame_sp)
116b5c0d1ccSJim Ingham         {
117b5c0d1ccSJim Ingham             const SymbolContext &older_context = older_frame_sp->GetSymbolContext(eSymbolContextEverything);
1185f1a4e1fSJim Ingham 
1195f1a4e1fSJim Ingham             // Match as much as is specified in the m_addr_context:
1205f1a4e1fSJim Ingham             // This is a fairly loose sanity check.  Note, sometimes the target doesn't get filled
1215f1a4e1fSJim Ingham             // in so I left out the target check.  And sometimes the module comes in as the .o file from the
1225f1a4e1fSJim Ingham             // inlined range, so I left that out too...
1235f1a4e1fSJim Ingham 
124513c6bb8SJim Ingham             bool older_ctx_is_equivalent = true;
1255f1a4e1fSJim Ingham             if (m_addr_context.comp_unit)
1265f1a4e1fSJim Ingham             {
1275f1a4e1fSJim Ingham                 if (m_addr_context.comp_unit == older_context.comp_unit)
1285f1a4e1fSJim Ingham                 {
1295f1a4e1fSJim Ingham                     if (m_addr_context.function && m_addr_context.function == older_context.function)
1305f1a4e1fSJim Ingham                     {
1315f1a4e1fSJim Ingham                         if (m_addr_context.block && m_addr_context.block == older_context.block)
1325f1a4e1fSJim Ingham                         {
1335f1a4e1fSJim Ingham                             older_ctx_is_equivalent = true;
1345f1a4e1fSJim Ingham                         }
1355f1a4e1fSJim Ingham                     }
1365f1a4e1fSJim Ingham                 }
1375f1a4e1fSJim Ingham             }
1385f1a4e1fSJim Ingham             else if (m_addr_context.symbol && m_addr_context.symbol == older_context.symbol)
1395f1a4e1fSJim Ingham             {
1405f1a4e1fSJim Ingham                 older_ctx_is_equivalent = true;
1415f1a4e1fSJim Ingham             }
1425f1a4e1fSJim Ingham 
1435f1a4e1fSJim Ingham             if (older_ctx_is_equivalent)
14430fdc8d8SChris Lattner             {
145481cef25SGreg Clayton                 new_plan = m_thread.QueueThreadPlanForStepOut (false,
146481cef25SGreg Clayton                                                            NULL,
147481cef25SGreg Clayton                                                            true,
148481cef25SGreg Clayton                                                            stop_others,
149e0d378b3SGreg Clayton                                                            eVoteNo,
150e0d378b3SGreg Clayton                                                            eVoteNoOpinion,
151481cef25SGreg Clayton                                                            0);
15230fdc8d8SChris Lattner             }
153b5c0d1ccSJim Ingham             else
154b5c0d1ccSJim Ingham             {
15518de2fdcSJim Ingham                 new_plan = m_thread.QueueThreadPlanForStepThrough (m_stack_id, false, stop_others);
156b5c0d1ccSJim Ingham 
157b5c0d1ccSJim Ingham             }
158b5c0d1ccSJim Ingham         }
159b5c0d1ccSJim Ingham     }
160564d8bc2SJim Ingham     else
161564d8bc2SJim Ingham     {
162564d8bc2SJim Ingham         // If we're still in the range, keep going.
163564d8bc2SJim Ingham         if (InRange())
164564d8bc2SJim Ingham         {
165564d8bc2SJim Ingham             SetNextBranchBreakpoint();
166564d8bc2SJim Ingham             return false;
167564d8bc2SJim Ingham         }
168564d8bc2SJim Ingham 
169564d8bc2SJim Ingham 
170564d8bc2SJim Ingham         if (!InSymbol())
17130fdc8d8SChris Lattner         {
17230fdc8d8SChris Lattner             // This one is a little tricky.  Sometimes we may be in a stub or something similar,
17330fdc8d8SChris Lattner             // in which case we need to get out of there.  But if we are in a stub then it's
17430fdc8d8SChris Lattner             // likely going to be hard to get out from here.  It is probably easiest to step into the
17530fdc8d8SChris Lattner             // stub, and then it will be straight-forward to step out.
17618de2fdcSJim Ingham             new_plan = m_thread.QueueThreadPlanForStepThrough (m_stack_id, false, stop_others);
17730fdc8d8SChris Lattner         }
178*3bfa753fSJim Ingham         else
179*3bfa753fSJim Ingham         {
180*3bfa753fSJim Ingham             // The current clang (at least through 424) doesn't always get the address range for the
181*3bfa753fSJim Ingham             // DW_TAG_inlined_subroutines right, so that when you leave the inlined range the line table says
182*3bfa753fSJim Ingham             // you are still in the source file of the inlining function.  This is bad, because now you are missing
183*3bfa753fSJim Ingham             // the stack frame for the function containing the inlining, and if you sensibly do "finish" to get
184*3bfa753fSJim Ingham             // out of this function you will instead exit the containing function.
185*3bfa753fSJim Ingham             // To work around this, we check whether we are still in the source file we started in, and if not assume
186*3bfa753fSJim Ingham             // it is an error, and push a plan to get us out of this line and back to the containing file.
187*3bfa753fSJim Ingham 
188*3bfa753fSJim Ingham             if (m_addr_context.line_entry.IsValid())
189*3bfa753fSJim Ingham             {
190*3bfa753fSJim Ingham                 SymbolContext sc;
191*3bfa753fSJim Ingham                 StackFrameSP frame_sp = m_thread.GetStackFrameAtIndex(0);
192*3bfa753fSJim Ingham                 sc = frame_sp->GetSymbolContext (eSymbolContextEverything);
193*3bfa753fSJim Ingham                 if (sc.line_entry.IsValid())
194*3bfa753fSJim Ingham                 {
195*3bfa753fSJim Ingham                     if (sc.line_entry.file != m_addr_context.line_entry.file
196*3bfa753fSJim Ingham                          && sc.comp_unit == m_addr_context.comp_unit
197*3bfa753fSJim Ingham                          && sc.function == m_addr_context.function)
198*3bfa753fSJim Ingham                     {
199*3bfa753fSJim Ingham                         // Okay, find the next occurance of this file in the line table:
200*3bfa753fSJim Ingham                         LineTable *line_table = m_addr_context.comp_unit->GetLineTable();
201*3bfa753fSJim Ingham                         if (line_table)
202*3bfa753fSJim Ingham                         {
203*3bfa753fSJim Ingham                             Address cur_address = frame_sp->GetFrameCodeAddress();
204*3bfa753fSJim Ingham                             uint32_t entry_idx;
205*3bfa753fSJim Ingham                             LineEntry line_entry;
206*3bfa753fSJim Ingham                             if (line_table->FindLineEntryByAddress (cur_address, line_entry, &entry_idx))
207*3bfa753fSJim Ingham                             {
208*3bfa753fSJim Ingham                                 LineEntry next_line_entry;
209*3bfa753fSJim Ingham                                 bool step_past_remaining_inline = false;
210*3bfa753fSJim Ingham                                 if (entry_idx > 0)
211*3bfa753fSJim Ingham                                 {
212*3bfa753fSJim Ingham                                     // We require the the previous line entry and the current line entry come
213*3bfa753fSJim Ingham                                     // from the same file.
214*3bfa753fSJim Ingham                                     // The other requirement is that the previous line table entry be part of an
215*3bfa753fSJim Ingham                                     // inlined block, we don't want to step past cases where people have inlined
216*3bfa753fSJim Ingham                                     // some code fragment by using #include <source-fragment.c> directly.
217*3bfa753fSJim Ingham                                     LineEntry prev_line_entry;
218*3bfa753fSJim Ingham                                     if (line_table->GetLineEntryAtIndex(entry_idx - 1, prev_line_entry)
219*3bfa753fSJim Ingham                                         && prev_line_entry.file == line_entry.file)
220*3bfa753fSJim Ingham                                     {
221*3bfa753fSJim Ingham                                         SymbolContext prev_sc;
222*3bfa753fSJim Ingham                                         Address prev_address = prev_line_entry.range.GetBaseAddress();
223*3bfa753fSJim Ingham                                         prev_address.CalculateSymbolContext(&prev_sc);
224*3bfa753fSJim Ingham                                         if (prev_sc.block)
225*3bfa753fSJim Ingham                                         {
226*3bfa753fSJim Ingham                                             Block *inlined_block = prev_sc.block->GetContainingInlinedBlock();
227*3bfa753fSJim Ingham                                             if (inlined_block)
228*3bfa753fSJim Ingham                                             {
229*3bfa753fSJim Ingham                                                 AddressRange inline_range;
230*3bfa753fSJim Ingham                                                 inlined_block->GetRangeContainingAddress(prev_address, inline_range);
231*3bfa753fSJim Ingham                                                 if (!inline_range.ContainsFileAddress(cur_address))
232*3bfa753fSJim Ingham                                                 {
233*3bfa753fSJim Ingham 
234*3bfa753fSJim Ingham                                                     step_past_remaining_inline = true;
235*3bfa753fSJim Ingham                                                 }
236*3bfa753fSJim Ingham 
237*3bfa753fSJim Ingham                                             }
238*3bfa753fSJim Ingham                                         }
239*3bfa753fSJim Ingham                                     }
240*3bfa753fSJim Ingham                                 }
241*3bfa753fSJim Ingham 
242*3bfa753fSJim Ingham                                 if (step_past_remaining_inline)
243*3bfa753fSJim Ingham                                 {
244*3bfa753fSJim Ingham                                     uint32_t look_ahead_step = 1;
245*3bfa753fSJim Ingham                                     while (line_table->GetLineEntryAtIndex(entry_idx + look_ahead_step, next_line_entry))
246*3bfa753fSJim Ingham                                     {
247*3bfa753fSJim Ingham                                         // Make sure we haven't wandered out of the function we started from...
248*3bfa753fSJim Ingham                                         Address next_line_address = next_line_entry.range.GetBaseAddress();
249*3bfa753fSJim Ingham                                         Function *next_line_function = next_line_address.CalculateSymbolContextFunction();
250*3bfa753fSJim Ingham                                         if (next_line_function != m_addr_context.function)
251*3bfa753fSJim Ingham                                             break;
252*3bfa753fSJim Ingham 
253*3bfa753fSJim Ingham                                         if (next_line_entry.file == m_addr_context.line_entry.file)
254*3bfa753fSJim Ingham                                         {
255*3bfa753fSJim Ingham                                             const bool abort_other_plans = false;
256*3bfa753fSJim Ingham                                             const bool stop_other_threads = false;
257*3bfa753fSJim Ingham                                             new_plan = m_thread.QueueThreadPlanForRunToAddress(abort_other_plans,
258*3bfa753fSJim Ingham                                                                                                next_line_address,
259*3bfa753fSJim Ingham                                                                                                stop_other_threads);
260*3bfa753fSJim Ingham                                             break;
261*3bfa753fSJim Ingham                                         }
262*3bfa753fSJim Ingham                                         look_ahead_step++;
263*3bfa753fSJim Ingham                                     }
264*3bfa753fSJim Ingham                                 }
265*3bfa753fSJim Ingham                             }
266*3bfa753fSJim Ingham                         }
267*3bfa753fSJim Ingham                     }
268*3bfa753fSJim Ingham                 }
269*3bfa753fSJim Ingham             }
270*3bfa753fSJim Ingham         }
271564d8bc2SJim Ingham     }
272564d8bc2SJim Ingham 
273564d8bc2SJim Ingham     // If we get to this point, we're not going to use a previously set "next branch" breakpoint, so delete it:
274564d8bc2SJim Ingham     ClearNextBranchBreakpoint();
27530fdc8d8SChris Lattner 
27630fdc8d8SChris Lattner     if (new_plan == NULL)
27730fdc8d8SChris Lattner         m_no_more_plans = true;
27830fdc8d8SChris Lattner     else
27930fdc8d8SChris Lattner         m_no_more_plans = false;
28030fdc8d8SChris Lattner 
28130fdc8d8SChris Lattner     if (new_plan == NULL)
28230fdc8d8SChris Lattner     {
28330fdc8d8SChris Lattner         // For efficiencies sake, we know we're done here so we don't have to do this
28430fdc8d8SChris Lattner         // calculation again in MischiefManaged.
28530fdc8d8SChris Lattner         SetPlanComplete();
28630fdc8d8SChris Lattner         return true;
28730fdc8d8SChris Lattner     }
28830fdc8d8SChris Lattner     else
28930fdc8d8SChris Lattner         return false;
29030fdc8d8SChris Lattner }
291fbbfe6ecSJim Ingham 
292fbbfe6ecSJim Ingham bool
293fbbfe6ecSJim Ingham ThreadPlanStepOverRange::PlanExplainsStop ()
294fbbfe6ecSJim Ingham {
295fbbfe6ecSJim Ingham     // For crashes, breakpoint hits, signals, etc, let the base plan (or some plan above us)
296fbbfe6ecSJim Ingham     // handle the stop.  That way the user can see the stop, step around, and then when they
297fbbfe6ecSJim Ingham     // are done, continue and have their step complete.  The exception is if we've hit our
298fbbfe6ecSJim Ingham     // "run to next branch" breakpoint.
299fbbfe6ecSJim Ingham     // Note, unlike the step in range plan, we don't mark ourselves complete if we hit an
300fbbfe6ecSJim Ingham     // unexplained breakpoint/crash.
301fbbfe6ecSJim Ingham 
302fbbfe6ecSJim Ingham     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
303fbbfe6ecSJim Ingham     StopInfoSP stop_info_sp = GetPrivateStopReason();
304fbbfe6ecSJim Ingham     if (stop_info_sp)
305fbbfe6ecSJim Ingham     {
306fbbfe6ecSJim Ingham         StopReason reason = stop_info_sp->GetStopReason();
307fbbfe6ecSJim Ingham 
308fbbfe6ecSJim Ingham         switch (reason)
309fbbfe6ecSJim Ingham         {
310513c6bb8SJim Ingham         case eStopReasonTrace:
311513c6bb8SJim Ingham             return true;
312513c6bb8SJim Ingham             break;
313fbbfe6ecSJim Ingham         case eStopReasonBreakpoint:
314fbbfe6ecSJim Ingham             if (NextRangeBreakpointExplainsStop(stop_info_sp))
315fbbfe6ecSJim Ingham                 return true;
316fbbfe6ecSJim Ingham             else
317fbbfe6ecSJim Ingham                 return false;
318fbbfe6ecSJim Ingham             break;
319fbbfe6ecSJim Ingham         case eStopReasonWatchpoint:
320fbbfe6ecSJim Ingham         case eStopReasonSignal:
321fbbfe6ecSJim Ingham         case eStopReasonException:
322513c6bb8SJim Ingham         default:
323fbbfe6ecSJim Ingham             if (log)
324fbbfe6ecSJim Ingham                 log->PutCString ("ThreadPlanStepInRange got asked if it explains the stop for some reason other than step.");
325fbbfe6ecSJim Ingham             return false;
326fbbfe6ecSJim Ingham             break;
327fbbfe6ecSJim Ingham         }
328fbbfe6ecSJim Ingham     }
329fbbfe6ecSJim Ingham     return true;
330fbbfe6ecSJim Ingham }
331513c6bb8SJim Ingham 
332513c6bb8SJim Ingham bool
333513c6bb8SJim Ingham ThreadPlanStepOverRange::WillResume (lldb::StateType resume_state, bool current_plan)
334513c6bb8SJim Ingham {
335513c6bb8SJim Ingham     if (resume_state != eStateSuspended && m_first_resume)
336513c6bb8SJim Ingham     {
337513c6bb8SJim Ingham         m_first_resume = false;
338513c6bb8SJim Ingham         if (resume_state == eStateStepping && current_plan)
339513c6bb8SJim Ingham         {
340513c6bb8SJim Ingham             // See if we are about to step over an inlined call in the middle of the inlined stack, if so figure
341513c6bb8SJim Ingham             // out its extents and reset our range to step over that.
342513c6bb8SJim Ingham             bool in_inlined_stack = m_thread.DecrementCurrentInlinedDepth();
343513c6bb8SJim Ingham             if (in_inlined_stack)
344513c6bb8SJim Ingham             {
345513c6bb8SJim Ingham                 LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
346513c6bb8SJim Ingham                 if (log)
347513c6bb8SJim Ingham                     log->Printf ("ThreadPlanStepInRange::WillResume: adjusting range to the frame at inlined depth %d.",
348513c6bb8SJim Ingham                                  m_thread.GetCurrentInlinedDepth());
349513c6bb8SJim Ingham                 StackFrameSP stack_sp = m_thread.GetStackFrameAtIndex(0);
350513c6bb8SJim Ingham                 if (stack_sp)
351513c6bb8SJim Ingham                 {
352513c6bb8SJim Ingham                     Block *frame_block = stack_sp->GetFrameBlock();
353513c6bb8SJim Ingham                     lldb::addr_t curr_pc = m_thread.GetRegisterContext()->GetPC();
354513c6bb8SJim Ingham                     AddressRange my_range;
355513c6bb8SJim Ingham                     if (frame_block->GetRangeContainingLoadAddress(curr_pc, m_thread.GetProcess()->GetTarget(), my_range))
356513c6bb8SJim Ingham                     {
357513c6bb8SJim Ingham                         m_address_ranges.clear();
358513c6bb8SJim Ingham                         m_address_ranges.push_back(my_range);
359513c6bb8SJim Ingham                         if (log)
360513c6bb8SJim Ingham                         {
361513c6bb8SJim Ingham                             StreamString s;
362513c6bb8SJim Ingham                             const InlineFunctionInfo *inline_info = frame_block->GetInlinedFunctionInfo();
363513c6bb8SJim Ingham                             const char *name;
364513c6bb8SJim Ingham                             if (inline_info)
365513c6bb8SJim Ingham                                 name = inline_info->GetName().AsCString();
366513c6bb8SJim Ingham                             else
367513c6bb8SJim Ingham                                 name = "<unknown-notinlined>";
368513c6bb8SJim Ingham 
369513c6bb8SJim Ingham                             s.Printf ("Stepping over inlined function \"%s\" in inlined stack: ", name);
370513c6bb8SJim Ingham                             DumpRanges(&s);
371513c6bb8SJim Ingham                             log->PutCString(s.GetData());
372513c6bb8SJim Ingham                         }
373513c6bb8SJim Ingham                     }
374513c6bb8SJim Ingham 
375513c6bb8SJim Ingham                 }
376513c6bb8SJim Ingham             }
377513c6bb8SJim Ingham         }
378513c6bb8SJim Ingham     }
379513c6bb8SJim Ingham 
380513c6bb8SJim Ingham     return ThreadPlan::WillResume(resume_state, current_plan);
381513c6bb8SJim Ingham }
382