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

Unified Diff: runtime/vm/object.cc

Issue 2813283002: Add --print_stacktrace_at_api_error. (Closed)
Patch Set: . Created 3 years, 8 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
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 69cd625ca603190014f9cf4a1be04b87a4b4d0bd..b012e5a80fe6bba680491c37853f7619fb627382 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -15178,6 +15178,13 @@ RawApiError* ApiError::New() {
RawApiError* ApiError::New(const String& message, Heap::Space space) {
+#ifndef PRODUCT
+ if (FLAG_print_stacktrace_at_api_error) {
+ OS::PrintErr("ApiError: %s\n", message.ToCString());
+ Profiler::DumpStackTrace(false /* for_crash */);
+ }
+#endif // !PRODUCT
+
ASSERT(Object::api_error_class() != Class::null());
ApiError& result = ApiError::Handle();
{
« no previous file with comments | « runtime/vm/flag_list.h ('k') | runtime/vm/profiler.h » ('j') | runtime/vm/profiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698