Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1364)

Unified Diff: runtime/vm/exceptions.cc

Issue 12578022: Added VM support for isolate stacktrace status. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: use AddEscapedString() Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/exceptions.h ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/exceptions.cc
===================================================================
--- runtime/vm/exceptions.cc (revision 20477)
+++ runtime/vm/exceptions.cc (working copy)
@@ -365,6 +365,30 @@
}
+const char* Exceptions::CreateStackTrace() {
+ Isolate* isolate = Isolate::Current();
+ Stacktrace& stacktrace = Stacktrace::Handle(isolate);
+ stacktrace ^= isolate->object_store()->preallocated_stack_trace();
+ RegularStacktraceBuilder frame_builder;
+ uword handler_pc = 0;
+ uword handler_sp = 0;
+ uword handler_fp = 0;
+ FindExceptionHandler(&handler_pc,
+ &handler_sp,
+ &handler_fp,
+ &frame_builder);
+ const Array& func_array =
+ Array::Handle(isolate, Array::MakeArray(frame_builder.func_list()));
+ const Array& code_array =
+ Array::Handle(isolate, Array::MakeArray(frame_builder.code_list()));
+ const Array& pc_offset_array =
+ Array::Handle(isolate,
+ Array::MakeArray(frame_builder.pc_offset_list()));
+ stacktrace = Stacktrace::New(func_array, code_array, pc_offset_array);
+ return stacktrace.ToCString();
+}
+
+
// Static helpers for allocating, initializing, and throwing an error instance.
// Return the script of the Dart function that called the native entry or the
« no previous file with comments | « runtime/vm/exceptions.h ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698