Index: runtime/vm/exceptions.cc |
=================================================================== |
--- runtime/vm/exceptions.cc (revision 16999) |
+++ runtime/vm/exceptions.cc (working copy) |
@@ -42,12 +42,31 @@ |
Smi& offset = Smi::Handle(); |
while (!frame->IsEntryFrame()) { |
if (frame->IsDartFrame()) { |
- func = frame->LookupDartFunction(); |
code = frame->LookupDartCode(); |
- offset = Smi::New(frame->pc() - code.EntryPoint()); |
- func_list.Add(func); |
- code_list.Add(code); |
- pc_offset_list.Add(offset); |
+ if (code.is_optimized()) { |
+ // For optimized frames, extract all the inlined functions if any |
+ // into the stack trace. |
+ InlinedFunctionsInDartFrameIterator optimized_frames(frame); |
+ while (true) { |
+ uword pc = 0; |
+ func = optimized_frames.GetNextFunction(&pc); |
+ if (func.IsNull()) { |
+ break; |
+ } |
+ ASSERT(pc != 0); |
+ code = func.unoptimized_code(); |
+ offset = Smi::New(pc - code.EntryPoint()); |
+ func_list.Add(func); |
+ code_list.Add(code); |
+ pc_offset_list.Add(offset); |
+ } |
+ } else { |
+ offset = Smi::New(frame->pc() - code.EntryPoint()); |
+ func = code.function(); |
+ func_list.Add(func); |
+ code_list.Add(code); |
+ pc_offset_list.Add(offset); |
+ } |
if (frame->FindExceptionHandler(handler_pc)) { |
*handler_sp = frame->sp(); |
*handler_fp = frame->fp(); |