| Index: runtime/vm/exceptions.cc
|
| ===================================================================
|
| --- runtime/vm/exceptions.cc (revision 19025)
|
| +++ runtime/vm/exceptions.cc (working copy)
|
| @@ -203,13 +203,30 @@
|
| Stacktrace& stacktrace = Stacktrace::Handle();
|
| if (pc_offset_list.Length() != 0) {
|
| if (existing_stacktrace.IsNull()) {
|
| - stacktrace = Stacktrace::New(func_list, code_list, pc_offset_list);
|
| + const Array& func_array = Array::Handle(Array::MakeArray(func_list));
|
| + const Array& code_array = Array::Handle(Array::MakeArray(code_list));
|
| + const Array& pc_offset_array =
|
| + Array::Handle(Array::MakeArray(pc_offset_list));
|
| +
|
| + stacktrace = Stacktrace::New(func_array, code_array, pc_offset_array);
|
| } else {
|
| stacktrace ^= existing_stacktrace.raw();
|
| stacktrace.Append(func_list, code_list, pc_offset_list);
|
| + // Since we are re throwing and appending to the existing stack trace
|
| + // we clear out the catch trace collected in the existing stack trace
|
| + // as that trace will not be valid anymore.
|
| + stacktrace.SetCatchStacktrace(Object::empty_array(),
|
| + Object::empty_array(),
|
| + Object::empty_array());
|
| }
|
| } else {
|
| stacktrace ^= existing_stacktrace.raw();
|
| + // Since we are re throwing the existing stack trace
|
| + // we clear out the catch trace collected in it
|
| + // as that trace will not be valid anymore.
|
| + stacktrace.SetCatchStacktrace(Object::empty_array(),
|
| + Object::empty_array(),
|
| + Object::empty_array());
|
| }
|
| if (FLAG_print_stacktrace_at_throw) {
|
| OS::Print("Exception '%s' thrown:\n", exception.ToCString());
|
|
|