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

Unified Diff: runtime/vm/debugger_api_impl.cc

Issue 10808032: Proper implementation of Dart_GetStackTrace. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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/debugger.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger_api_impl.cc
diff --git a/runtime/vm/debugger_api_impl.cc b/runtime/vm/debugger_api_impl.cc
index 87c6f46d1bba4f486ba442dbf0fc9d86e1522035..4518faa595c9fc0f7b4f8e94ee9381ef36d10104 100644
--- a/runtime/vm/debugger_api_impl.cc
+++ b/runtime/vm/debugger_api_impl.cc
@@ -172,6 +172,20 @@ DART_EXPORT Dart_Handle Dart_GetStackTrace(Dart_StackTrace* trace) {
return Api::True(isolate);
}
+DART_EXPORT Dart_Handle Dart_GetStackTrace2() {
+ Isolate* isolate = Isolate::Current();
+ DARTSCOPE(isolate);
+ const GrowableObjectArray& scriptUrls =
+ GrowableObjectArray::Handle(GrowableObjectArray::New(8));
+ DebuggerStackTrace* stackTrace = isolate->debugger()->CollectStackTrace();
+ for (intptr_t i = 0; i < stackTrace->Length(); ++i) {
+ String& scriptUrl = String::Handle();
+ scriptUrl ^= stackTrace->ActivationFrameAt(i)->SourceUrl();
+ scriptUrls.Add(scriptUrl);
+ }
+ return Api::NewHandle(isolate, Array::MakeArray(scriptUrls));
+}
+
DART_EXPORT Dart_Handle Dart_ActivationFrameInfo(
Dart_ActivationFrame activation_frame,
« no previous file with comments | « runtime/vm/debugger.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698