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

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, 1 month 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/debugger.h » ('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 805737c50417d4fcbb13b6add6b48c06b3dd9e4d..4039f49e54b8c2163fe20b21afd76da814fef248 100755
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -199,6 +199,8 @@ typedef void (*Dart_WeakPersistentHandleFinalizer)(
void* peer);
typedef void (*Dart_PeerFinalizer)(void* peer);
+typedef struct _Dart_ExceptionStackTrace* Dart_ExceptionStackTrace;
rmacnak 2013/11/07 21:31:12 This is a bad name considering the Dart_CurrentSta
+
/**
* Is this an error handle?
*
@@ -276,8 +278,58 @@ DART_EXPORT Dart_Handle Dart_ErrorGetException(Dart_Handle handle);
/**
* Gets the stack trace Object from an unhandled exception error handle.
+ *
+ * \param handle An unhandled exception error.
+ * \param trace Receives the stack trace.
+ *
+ * \return A valid handle if no error occurs during the operation.
*/
-DART_EXPORT Dart_Handle Dart_ErrorGetStacktrace(Dart_Handle handle);
+DART_EXPORT Dart_Handle Dart_ErrorGetStacktrace(
rmacnak 2013/11/07 21:31:12 Note this no longer provides access to dart:core.S
+ Dart_Handle handle,
+ Dart_ExceptionStackTrace *trace);
+DART_EXPORT Dart_Handle Dart_CurrentStacktrace(
+ Dart_ExceptionStackTrace *trace);
+
+/**
+ * Gets the number of frames in a stack trace.
+ *
+ * \param trace The stack trace.
+ * \param length Receives the frame count.
+ *
+ * \return A valid handle if no error occurs during the operation.
+ */
+DART_EXPORT Dart_Handle Dart_StacktraceLength(Dart_ExceptionStackTrace trace,
+ intptr_t* length);
+
+/**
+ * Returns information about a given frame in a stack trace
+ *
+ * \param trace The stack trace.
+ * \param frame_index The position of the frame in the stacktrace. Top-of-stack
+ * is at position 0.
+ *
+ * \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_ExceptionStackTrace trace,
+ 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/debugger.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698