From 557b40d90c729864e654335a8f3da95b22938c76 Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Tue, 11 Feb 2014 07:28:05 +0000 Subject: [PATCH] Add flag to print stack trace on illegal exception. This would help a lot with native Javascript code. R=mvstanton@chromium.org Review URL: https://codereview.chromium.org/156373003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19251 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/flag-definitions.h | 2 ++ src/isolate.cc | 1 + 2 files changed, 3 insertions(+) diff --git a/src/flag-definitions.h b/src/flag-definitions.h index c0eaf16..688b481 100644 --- a/src/flag-definitions.h +++ b/src/flag-definitions.h @@ -591,6 +591,8 @@ DEFINE_int(sim_stack_alignment, 8, "Stack alingment in bytes in simulator (4 or 8, 8 is default)") // isolate.cc +DEFINE_bool(stack_trace_on_illegal, false, + "print stack trace when an illegal exception is thrown") DEFINE_bool(abort_on_uncaught_exception, false, "abort program (dump core) when an uncaught exception is thrown") DEFINE_bool(trace_exception, false, diff --git a/src/isolate.cc b/src/isolate.cc index 8a2f421..54d614a 100644 --- a/src/isolate.cc +++ b/src/isolate.cc @@ -946,6 +946,7 @@ Failure* Isolate::ReThrow(MaybeObject* exception) { Failure* Isolate::ThrowIllegalOperation() { + if (FLAG_stack_trace_on_illegal) PrintStack(stdout); return Throw(heap_.illegal_access_string()); } -- 2.7.4