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

Unified Diff: runtime/vm/object.cc

Issue 12381030: Fix stack frame index numbers for full stack traces (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 19271)
+++ runtime/vm/object.cc (working copy)
@@ -12989,20 +12989,20 @@
RawString* Stacktrace::FullStacktrace() const {
const Array& func_array = Array::Handle(raw_ptr()->catch_func_array_);
- if (!func_array.IsNull() &&
- func_array.raw() != Object::empty_array().raw()) {
+ if (!func_array.IsNull() && (func_array.Length() > 0)) {
const Array& code_array = Array::Handle(raw_ptr()->catch_code_array_);
const Array& pc_offset_array =
Array::Handle(raw_ptr()->catch_pc_offset_array_);
const Stacktrace& catch_trace = Stacktrace::Handle(
Stacktrace::New(func_array, code_array, pc_offset_array));
+ intptr_t idx = Length();
const String& trace =
- String::Handle(String::New(catch_trace.ToCStringInternal()));
+ String::Handle(String::New(catch_trace.ToCStringInternal(idx)));
const String& throw_trace =
- String::Handle(String::New(ToCStringInternal()));
+ String::Handle(String::New(ToCStringInternal(0)));
return String::Concat(throw_trace, trace);
}
- return String::New(ToCStringInternal());
+ return String::New(ToCStringInternal(0));
}
@@ -13012,7 +13012,7 @@
}
-const char* Stacktrace::ToCStringInternal() const {
+const char* Stacktrace::ToCStringInternal(intptr_t frame_index) const {
Isolate* isolate = Isolate::Current();
Function& function = Function::Handle();
Code& code = Code::Handle();
@@ -13052,14 +13052,14 @@
script.GetTokenLocation(token_pos, &line, &column);
}
intptr_t len = OS::SNPrint(NULL, 0, kFormat,
- i,
+ (frame_index + i),
function_name.ToCString(),
url.ToCString(),
line, column);
total_len += len;
chars = isolate->current_zone()->Alloc<char>(len + 1);
OS::SNPrint(chars, (len + 1), kFormat,
- i,
+ (frame_index + i),
function_name.ToCString(),
url.ToCString(),
line, column);
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698