Make Runtime_Abort print to stderr instead of stdout.

R=mvstanton@chromium.org

Review URL: https://codereview.chromium.org/15298005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14726 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 881476a7
...@@ -53,7 +53,7 @@ extern "C" void V8_Fatal(const char* file, int line, const char* format, ...) { ...@@ -53,7 +53,7 @@ extern "C" void V8_Fatal(const char* file, int line, const char* format, ...) {
if (fatal_error_handler_nesting_depth < 3) { if (fatal_error_handler_nesting_depth < 3) {
if (i::FLAG_stack_trace_on_abort) { if (i::FLAG_stack_trace_on_abort) {
// Call this one twice on double fault // Call this one twice on double fault
i::Isolate::Current()->PrintStack(); i::Isolate::Current()->PrintStack(stderr);
} }
} }
i::OS::Abort(); i::OS::Abort();
......
...@@ -5933,7 +5933,7 @@ bool Heap::IdleGlobalGC() { ...@@ -5933,7 +5933,7 @@ bool Heap::IdleGlobalGC() {
void Heap::Print() { void Heap::Print() {
if (!HasBeenSetUp()) return; if (!HasBeenSetUp()) return;
isolate()->PrintStack(); isolate()->PrintStack(stdout);
AllSpaces spaces(this); AllSpaces spaces(this);
for (Space* space = spaces.next(); space != NULL; space = spaces.next()) { for (Space* space = spaces.next(); space != NULL; space = spaces.next()) {
space->Print(); space->Print();
......
...@@ -835,7 +835,7 @@ Handle<JSArray> Isolate::CaptureCurrentStackTrace( ...@@ -835,7 +835,7 @@ Handle<JSArray> Isolate::CaptureCurrentStackTrace(
} }
void Isolate::PrintStack() { void Isolate::PrintStack(FILE* out) {
if (stack_trace_nesting_level_ == 0) { if (stack_trace_nesting_level_ == 0) {
stack_trace_nesting_level_++; stack_trace_nesting_level_++;
...@@ -850,7 +850,7 @@ void Isolate::PrintStack() { ...@@ -850,7 +850,7 @@ void Isolate::PrintStack() {
StringStream accumulator(allocator); StringStream accumulator(allocator);
incomplete_message_ = &accumulator; incomplete_message_ = &accumulator;
PrintStack(&accumulator); PrintStack(&accumulator);
accumulator.OutputToStdOut(); accumulator.OutputToFile(out);
InitializeLoggingAndCounters(); InitializeLoggingAndCounters();
accumulator.Log(); accumulator.Log();
incomplete_message_ = NULL; incomplete_message_ = NULL;
...@@ -865,7 +865,7 @@ void Isolate::PrintStack() { ...@@ -865,7 +865,7 @@ void Isolate::PrintStack() {
"\n\nAttempt to print stack while printing stack (double fault)\n"); "\n\nAttempt to print stack while printing stack (double fault)\n");
OS::PrintError( OS::PrintError(
"If you are lucky you may find a partial stack dump on stdout.\n\n"); "If you are lucky you may find a partial stack dump on stdout.\n\n");
incomplete_message_->OutputToStdOut(); incomplete_message_->OutputToFile(out);
} }
} }
......
...@@ -725,7 +725,7 @@ class Isolate { ...@@ -725,7 +725,7 @@ class Isolate {
void PrintCurrentStackTrace(FILE* out); void PrintCurrentStackTrace(FILE* out);
void PrintStackTrace(FILE* out, char* thread_data); void PrintStackTrace(FILE* out, char* thread_data);
void PrintStack(StringStream* accumulator); void PrintStack(StringStream* accumulator);
void PrintStack(); void PrintStack(FILE* out);
Handle<String> StackTraceString(); Handle<String> StackTraceString();
NO_INLINE(void PushStackTraceAndDie(unsigned int magic, NO_INLINE(void PushStackTraceAndDie(unsigned int magic,
Object* object, Object* object,
......
...@@ -8991,7 +8991,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPrint) { ...@@ -8991,7 +8991,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPrint) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugTrace) { RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugTrace) {
NoHandleAllocation ha(isolate); NoHandleAllocation ha(isolate);
ASSERT(args.length() == 0); ASSERT(args.length() == 0);
isolate->PrintStack(); isolate->PrintStack(stdout);
return isolate->heap()->undefined_value(); return isolate->heap()->undefined_value();
} }
...@@ -13099,7 +13099,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Abort) { ...@@ -13099,7 +13099,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Abort) {
ASSERT(args.length() == 2); ASSERT(args.length() == 2);
OS::PrintError("abort: %s\n", OS::PrintError("abort: %s\n",
reinterpret_cast<char*>(args[0]) + args.smi_at(1)); reinterpret_cast<char*>(args[0]) + args.smi_at(1));
isolate->PrintStack(); isolate->PrintStack(stderr);
OS::Abort(); OS::Abort();
UNREACHABLE(); UNREACHABLE();
return NULL; return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment