Reviewers: Rico,

Message:
Thank you so much, Rico, this will really help us out.

I tried PrintCurrentStackTrace(stderr) and didn't see any output at all, but if
you can get it working, hooray!

Description:
Terrible, no-good change that attempts to print out errors
when loading v8 extensions.

Please review this at http://codereview.chromium.org/8073013/

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/bootstrapper.cc


Index: src/bootstrapper.cc
===================================================================
--- src/bootstrapper.cc (revision 9475)
+++ src/bootstrapper.cc (working copy)
@@ -37,6 +37,7 @@
 #include "macro-assembler.h"
 #include "natives.h"
 #include "objects-visiting.h"
+#include "platform.h"
 #include "snapshot.h"
 #include "extensions/externalize-string-extension.h"
 #include "extensions/gc-extension.h"
@@ -1988,6 +1989,19 @@
       false);
   ASSERT(isolate->has_pending_exception() != result);
   if (!result) {
+    OS::PrintError("Error installing extension '%s'.\n",
+                   current->extension()->name());
+    if (!isolate->pending_exception()->IsFailure()) {
+ Handle<Object> object(isolate->pending_exception()->ToObjectUnchecked());
+      MaybeObject* stack =
+          object->GetProperty(*isolate->factory()->NewStringFromAscii(
+              CStrVector("stack")));
+      if (!stack->IsFailure()) {
+        SmartArrayPointer<char> stack_array =
+            static_cast<String*>(stack)->ToCString();
+        OS::PrintError("%s\n", *stack_array);
+      }
+    }
     isolate->clear_pending_exception();
   }
   current->set_state(v8::INSTALLED);


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to