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

Side by Side 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, 7 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/debug/debug.h" 5 #include "src/debug/debug.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/arguments.h" 8 #include "src/arguments.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 2240 matching lines...) Expand 10 before | Expand all | Expand 10 after
2251 int source_position = 2251 int source_position =
2252 summary.abstract_code()->SourcePosition(summary.code_offset()); 2252 summary.abstract_code()->SourcePosition(summary.code_offset());
2253 Handle<Object> script_obj(summary.function()->shared()->script(), isolate_); 2253 Handle<Object> script_obj(summary.function()->shared()->script(), isolate_);
2254 PrintF("[debug] break in function '"); 2254 PrintF("[debug] break in function '");
2255 summary.function()->PrintName(); 2255 summary.function()->PrintName();
2256 PrintF("'.\n"); 2256 PrintF("'.\n");
2257 if (script_obj->IsScript()) { 2257 if (script_obj->IsScript()) {
2258 Handle<Script> script = Handle<Script>::cast(script_obj); 2258 Handle<Script> script = Handle<Script>::cast(script_obj);
2259 Handle<String> source(String::cast(script->source())); 2259 Handle<String> source(String::cast(script->source()));
2260 Script::InitLineEnds(script); 2260 Script::InitLineEnds(script);
2261 int line = Script::GetLineNumber(script, source_position); 2261 int line =
2262 int column = Script::GetColumnNumber(script, source_position); 2262 Script::GetLineNumber(script, source_position) - script->line_offset();
2263 int column = Script::GetColumnNumber(script, source_position) -
2264 (line == 0 ? script->column_offset() : 0);
2263 Handle<FixedArray> line_ends(FixedArray::cast(script->line_ends())); 2265 Handle<FixedArray> line_ends(FixedArray::cast(script->line_ends()));
2264 int line_start = 2266 int line_start =
2265 line == 0 ? 0 : Smi::cast(line_ends->get(line - 1))->value() + 1; 2267 line == 0 ? 0 : Smi::cast(line_ends->get(line - 1))->value() + 1;
2266 int line_end = Smi::cast(line_ends->get(line))->value(); 2268 int line_end = Smi::cast(line_ends->get(line))->value();
2267 DisallowHeapAllocation no_gc; 2269 DisallowHeapAllocation no_gc;
2268 String::FlatContent content = source->GetFlatContent(); 2270 String::FlatContent content = source->GetFlatContent();
2269 if (content.IsOneByte()) { 2271 if (content.IsOneByte()) {
2270 PrintF("[debug] %.*s\n", line_end - line_start, 2272 PrintF("[debug] %.*s\n", line_end - line_start,
2271 content.ToOneByteVector().start() + line_start); 2273 content.ToOneByteVector().start() + line_start);
2272 PrintF("[debug] "); 2274 PrintF("[debug] ");
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
2584 } 2586 }
2585 2587
2586 2588
2587 void LockingCommandMessageQueue::Clear() { 2589 void LockingCommandMessageQueue::Clear() {
2588 base::LockGuard<base::Mutex> lock_guard(&mutex_); 2590 base::LockGuard<base::Mutex> lock_guard(&mutex_);
2589 queue_.Clear(); 2591 queue_.Clear();
2590 } 2592 }
2591 2593
2592 } // namespace internal 2594 } // namespace internal
2593 } // namespace v8 2595 } // namespace v8
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