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

Unified Diff: runtime/include/dart_api.h

Issue 51793002: Add an API function to get a debugger stack trace from an error handle. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | runtime/vm/object.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_api.h
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
index 3cc6fb5ea0ef0eb286a367088c1d494e35155959..898b6686f8936714d661b863fce036a6744c4b98 100755
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -279,6 +279,48 @@ DART_EXPORT Dart_Handle Dart_ErrorGetException(Dart_Handle handle);
*/
DART_EXPORT Dart_Handle Dart_ErrorGetStacktrace(Dart_Handle handle);
+
+/**
+ * Gets the number of frames in a Stacktrace.
+ *
+ * \param handle A Stacktrace.
siva 2013/10/31 17:13:26 maybe call it handle instead of stacktrace.
+ * \param length Returns the frame count.
+ *
+ * \return A valid handle if no error occurs during the operation.
+ */
+DART_EXPORT Dart_Handle Dart_StacktraceLength(Dart_Handle handle,
+ intptr_t* length);
+
+/**
+ * Returns information about a given frame in a Stacktrace
+ *
+ * \param handle A Stacktrace.
siva 2013/10/31 17:13:26 Ditto comment.
+ * \param frame_index The position of the frame of the stack. Top-of-stack is at
+ * position 0.
siva 2013/10/31 17:13:26 position of the frame in the stacktrace?
+ *
+ * \param function_name receives a string handle with the qualified function
+ * name.
+ * \param script_url receives a string handle with the url of the source script
+ * that contains the frame's function.
+ * \param line_number receives the line number in the script.
+ * \param column_number receives the column number in the script, or -1 if
+ * precise source locations are not available.
+ *
+ * Any or all of the out parameters above may be NULL.
+ *
+ * Requires there to be a current isolate.
+ *
+ * \return A valid handle if no error occurs during the operation.
+ */
+DART_EXPORT Dart_Handle Dart_StacktraceFrameInfo(
+ Dart_Handle handle,
+ intptr_t frame_index,
+ Dart_Handle* function_name,
+ Dart_Handle* script_url,
+ intptr_t* line_number,
+ intptr_t* column_number);
+
+
/**
* Produces an api error handle with the provided error message.
*
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698