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

Unified Diff: src/d8.cc

Issue 2733783002: [debug] change coverage API to use offset instead of line/column. (Closed)
Patch Set: rebase Created 3 years, 9 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 | « src/api.cc ('k') | src/debug/debug-interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8.cc
diff --git a/src/d8.cc b/src/d8.cc
index 1e9d2c64ce799de0153e85c3ebdce4de32110261..9cf30fba3967cef40358d90b859e6dfa1adc358c 100644
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -1713,8 +1713,12 @@ void Shell::WriteLcovData(v8::Isolate* isolate, const char* file) {
for (size_t j = 0; j < script_data.FunctionCount(); j++) {
debug::Coverage::FunctionData function_data =
script_data.GetFunctionData(j);
- int start_line = function_data.Start().GetLineNumber();
- int end_line = function_data.End().GetLineNumber();
+ debug::Location start =
+ script->GetSourceLocation(function_data.StartOffset());
+ debug::Location end =
+ script->GetSourceLocation(function_data.EndOffset());
+ int start_line = start.GetLineNumber();
+ int end_line = end.GetLineNumber();
uint32_t count = function_data.Count();
// Ensure space in the array.
lines.resize(std::max(static_cast<size_t>(end_line + 1), lines.size()),
@@ -1732,7 +1736,7 @@ void Shell::WriteLcovData(v8::Isolate* isolate, const char* file) {
name_stream << ToSTLString(name);
} else {
name_stream << "<" << start_line + 1 << "-";
- name_stream << function_data.Start().GetColumnNumber() << ">";
+ name_stream << start.GetColumnNumber() << ">";
}
sink << "FN:" << start_line + 1 << "," << name_stream.str() << std::endl;
sink << "FNDA:" << count << "," << name_stream.str() << std::endl;
« no previous file with comments | « src/api.cc ('k') | src/debug/debug-interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698