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

Unified Diff: src/debug/debug.cc

Issue 1928943002: [debugger] account for script source offsets in --print-break-location. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug.cc
diff --git a/src/debug/debug.cc b/src/debug/debug.cc
index 3445d267d28752e103863f9c57fdc1b055b96b83..6342b63b60b83abbb06da4fec0701eb17d40843a 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -2258,8 +2258,10 @@ void Debug::PrintBreakLocation() {
Handle<Script> script = Handle<Script>::cast(script_obj);
Handle<String> source(String::cast(script->source()));
Script::InitLineEnds(script);
- int line = Script::GetLineNumber(script, source_position);
- int column = Script::GetColumnNumber(script, source_position);
+ int line =
+ Script::GetLineNumber(script, source_position) - script->line_offset();
+ int column = Script::GetColumnNumber(script, source_position) -
+ (line == 0 ? script->column_offset() : 0);
Handle<FixedArray> line_ends(FixedArray::cast(script->line_ends()));
int line_start =
line == 0 ? 0 : Smi::cast(line_ends->get(line - 1))->value() + 1;
« 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