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

Side by Side Diff: src/isolate.cc

Issue 11577019: V8_Fatal now prints C++ stack trace in debug mode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/checks.cc ('k') | src/platform.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 StackFrameIterator it; 805 StackFrameIterator it;
806 for (int i = 0; !it.done(); it.Advance()) { 806 for (int i = 0; !it.done(); it.Advance()) {
807 it.frame()->Print(accumulator, mode, i++); 807 it.frame()->Print(accumulator, mode, i++);
808 } 808 }
809 } 809 }
810 810
811 811
812 void Isolate::PrintStack(StringStream* accumulator) { 812 void Isolate::PrintStack(StringStream* accumulator) {
813 if (!IsInitialized()) { 813 if (!IsInitialized()) {
814 accumulator->Add( 814 accumulator->Add(
815 "\n==== Stack trace is not available ==========================\n\n"); 815 "\n==== JS stack trace is not available =======================\n\n");
816 accumulator->Add( 816 accumulator->Add(
817 "\n==== Isolate for the thread is not initialized =============\n\n"); 817 "\n==== Isolate for the thread is not initialized =============\n\n");
818 return; 818 return;
819 } 819 }
820 // The MentionedObjectCache is not GC-proof at the moment. 820 // The MentionedObjectCache is not GC-proof at the moment.
821 AssertNoAllocation nogc; 821 AssertNoAllocation nogc;
822 ASSERT(StringStream::IsMentionedObjectCacheClear()); 822 ASSERT(StringStream::IsMentionedObjectCacheClear());
823 823
824 // Avoid printing anything if there are no frames. 824 // Avoid printing anything if there are no frames.
825 if (c_entry_fp(thread_local_top()) == 0) return; 825 if (c_entry_fp(thread_local_top()) == 0) return;
826 826
827 accumulator->Add( 827 accumulator->Add(
828 "\n==== Stack trace ============================================\n\n"); 828 "\n==== JS stack trace =========================================\n\n");
829 PrintFrames(accumulator, StackFrame::OVERVIEW); 829 PrintFrames(accumulator, StackFrame::OVERVIEW);
830 830
831 accumulator->Add( 831 accumulator->Add(
832 "\n==== Details ================================================\n\n"); 832 "\n==== Details ================================================\n\n");
833 PrintFrames(accumulator, StackFrame::DETAILS); 833 PrintFrames(accumulator, StackFrame::DETAILS);
834 834
835 accumulator->PrintMentionedObjectCache(); 835 accumulator->PrintMentionedObjectCache();
836 accumulator->Add("=====================\n\n"); 836 accumulator->Add("=====================\n\n");
837 } 837 }
838 838
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after
2177 2177
2178 #ifdef DEBUG 2178 #ifdef DEBUG
2179 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ 2179 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
2180 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); 2180 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
2181 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) 2181 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET)
2182 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 2182 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
2183 #undef ISOLATE_FIELD_OFFSET 2183 #undef ISOLATE_FIELD_OFFSET
2184 #endif 2184 #endif
2185 2185
2186 } } // namespace v8::internal 2186 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/checks.cc ('k') | src/platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698