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

Unified Diff: runtime/vm/object.cc

Issue 904443002: VM: Fix source location in stack trace of async code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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 | « no previous file | runtime/vm/parser.cc » ('j') | 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 43463)
+++ runtime/vm/object.cc (working copy)
@@ -20123,6 +20123,7 @@
intptr_t frame_index) {
const char* kFormatWithCol = "#%-6d %s (%s:%d:%d)\n";
const char* kFormatNoCol = "#%-6d %s (%s:%d)\n";
+ const char* kFormatNoLine = "#%-6d %s (%s)\n";
const intptr_t token_pos = code.GetTokenIndexOfPC(pc);
const Script& script = Script::Handle(isolate, function.script());
const String& function_name =
@@ -20130,7 +20131,7 @@
const String& url = String::Handle(isolate, script.url());
intptr_t line = -1;
intptr_t column = -1;
- if (token_pos >= 0) {
+ if (token_pos > 0) {
if (script.HasSource()) {
script.GetTokenLocation(token_pos, &line, &column);
} else {
@@ -20148,7 +20149,7 @@
frame_index,
function_name.ToCString(),
url.ToCString(), line, column);
- } else {
+ } else if (line >= 0) {
len = OS::SNPrint(NULL, 0, kFormatNoCol,
frame_index, function_name.ToCString(),
url.ToCString(), line);
@@ -20156,6 +20157,14 @@
OS::SNPrint(chars, (len + 1), kFormatNoCol,
frame_index, function_name.ToCString(),
url.ToCString(), line);
+ } else {
+ len = OS::SNPrint(NULL, 0, kFormatNoLine,
+ frame_index, function_name.ToCString(),
+ url.ToCString());
+ chars = isolate->current_zone()->Alloc<char>(len + 1);
+ OS::SNPrint(chars, (len + 1), kFormatNoLine,
+ frame_index, function_name.ToCString(),
+ url.ToCString());
}
frame_strings->Add(chars);
return len;
« no previous file with comments | « no previous file | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698