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

Side by Side Diff: runtime/vm/object.cc

Issue 1174083002: Fix printing of stack overflow stacktraces (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: c Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 20568 matching lines...) Expand 10 before | Expand all | Expand 10 after
20579 function = FunctionAtFrame(i); 20579 function = FunctionAtFrame(i);
20580 if (function.IsNull()) { 20580 if (function.IsNull()) {
20581 // Check if null function object indicates a stack trace overflow. 20581 // Check if null function object indicates a stack trace overflow.
20582 if ((i < (Length() - 1)) && 20582 if ((i < (Length() - 1)) &&
20583 (FunctionAtFrame(i + 1) != Function::null())) { 20583 (FunctionAtFrame(i + 1) != Function::null())) {
20584 const char* kTruncated = "...\n...\n"; 20584 const char* kTruncated = "...\n...\n";
20585 intptr_t truncated_len = strlen(kTruncated) + 1; 20585 intptr_t truncated_len = strlen(kTruncated) + 1;
20586 char* chars = isolate->current_zone()->Alloc<char>(truncated_len); 20586 char* chars = isolate->current_zone()->Alloc<char>(truncated_len);
20587 OS::SNPrint(chars, truncated_len, "%s", kTruncated); 20587 OS::SNPrint(chars, truncated_len, "%s", kTruncated);
20588 frame_strings.Add(chars); 20588 frame_strings.Add(chars);
20589 total_len += truncated_len;
20589 } 20590 }
20590 } else if (function.is_visible() || FLAG_show_invisible_frames) { 20591 } else if (function.is_visible() || FLAG_show_invisible_frames) {
20591 code = CodeAtFrame(i); 20592 code = CodeAtFrame(i);
20592 ASSERT(function.raw() == code.function()); 20593 ASSERT(function.raw() == code.function());
20593 uword pc = code.EntryPoint() + Smi::Value(PcOffsetAtFrame(i)); 20594 uword pc = code.EntryPoint() + Smi::Value(PcOffsetAtFrame(i));
20594 if (code.is_optimized() && expand_inlined()) { 20595 if (code.is_optimized() && expand_inlined()) {
20595 // Traverse inlined frames. 20596 // Traverse inlined frames.
20596 for (InlinedFunctionsIterator it(code, pc); 20597 for (InlinedFunctionsIterator it(code, pc);
20597 !it.Done() && (*frame_index < max_frames); it.Advance()) { 20598 !it.Done() && (*frame_index < max_frames); it.Advance()) {
20598 function = it.function(); 20599 function = it.function();
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
20959 return tag_label.ToCString(); 20960 return tag_label.ToCString();
20960 } 20961 }
20961 20962
20962 20963
20963 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 20964 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
20964 Instance::PrintJSONImpl(stream, ref); 20965 Instance::PrintJSONImpl(stream, ref);
20965 } 20966 }
20966 20967
20967 20968
20968 } // namespace dart 20969 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698