Chromium Code Reviews| Index: runtime/vm/exceptions.cc |
| =================================================================== |
| --- runtime/vm/exceptions.cc (revision 17416) |
| +++ runtime/vm/exceptions.cc (working copy) |
| @@ -20,11 +20,20 @@ |
| "Prints a stack trace everytime a throw occurs."); |
| DEFINE_FLAG(bool, heap_profile_out_of_memory, false, |
| "Writes a heap profile on unhandled out-of-memory exceptions."); |
| +DEFINE_FLAG(bool, verbose_stacktrace, false, |
| + "Includes also core-lib's private methods"); |
|
Ivan Posva
2013/01/23 01:17:26
private -> invisible
siva
2013/01/23 01:40:22
Since we plan on allowing some non core-lib method
srdjan
2013/01/23 19:22:29
Done.
srdjan
2013/01/23 19:22:29
Done.
|
| - |
| const char* Exceptions::kCastErrorDstName = "type cast"; |
| +static bool ShouldShowFunction(const Function& function) { |
| + if (FLAG_verbose_stacktrace) { |
| + return true; |
| + } |
| + return function.is_visible(); |
| +} |
| + |
| + |
| // Iterate through the stack frames and try to find a frame with an |
| // exception handler. Once found, set the pc, sp and fp so that execution |
| // can continue in that frame. |
| @@ -56,16 +65,20 @@ |
| ASSERT(pc != 0); |
| code = func.unoptimized_code(); |
| offset = Smi::New(pc - code.EntryPoint()); |
| + if (ShouldShowFunction(func)) { |
| + func_list.Add(func); |
| + code_list.Add(code); |
| + pc_offset_list.Add(offset); |
| + } |
| + } |
| + } else { |
| + offset = Smi::New(frame->pc() - code.EntryPoint()); |
| + func = code.function(); |
| + if (ShouldShowFunction(func)) { |
| 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(); |