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

Unified Diff: src/debug/debug.cc

Issue 1744123003: [debugger] fix break locations for assignments and return. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixes and addressed comments Created 4 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 | « src/debug/debug.h ('k') | src/full-codegen/full-codegen.cc » ('j') | 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 a15743dcd6e303dd1a0c67c31b371eccd4981b6f..56eb8cbdd998aaac176c4920e07c4cef88cab7e0 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -84,6 +84,15 @@ BreakLocation::Iterator::Iterator(Handle<DebugInfo> debug_info)
position_(1),
statement_position_(1) {}
+int BreakLocation::Iterator::ReturnPosition() {
+ if (debug_info_->shared()->HasSourceCode()) {
+ return debug_info_->shared()->end_position() -
+ debug_info_->shared()->start_position() - 1;
+ } else {
+ return 0;
+ }
+}
+
BreakLocation::CodeIterator::CodeIterator(Handle<DebugInfo> debug_info,
BreakLocatorType type)
: Iterator(debug_info),
@@ -137,13 +146,7 @@ void BreakLocation::CodeIterator::Next() {
if (RelocInfo::IsDebugBreakSlotAtReturn(rmode())) {
// Set the positions to the end of the function.
- if (debug_info_->shared()->HasSourceCode()) {
- position_ = debug_info_->shared()->end_position() -
- debug_info_->shared()->start_position() - 1;
- } else {
- position_ = 0;
- }
- statement_position_ = position_;
+ statement_position_ = position_ = ReturnPosition();
}
break;
@@ -201,8 +204,10 @@ void BreakLocation::BytecodeArrayIterator::Next() {
if (break_locator_type_ == ALL_BREAK_LOCATIONS) break;
DCHECK_EQ(CALLS_AND_RETURNS, break_locator_type_);
- if (type == DEBUG_BREAK_SLOT_AT_CALL ||
- type == DEBUG_BREAK_SLOT_AT_RETURN) {
+ if (type == DEBUG_BREAK_SLOT_AT_CALL) break;
+ if (type == DEBUG_BREAK_SLOT_AT_RETURN) {
+ DCHECK_EQ(ReturnPosition(), position_);
+ DCHECK_EQ(ReturnPosition(), statement_position_);
break;
}
}
« no previous file with comments | « src/debug/debug.h ('k') | src/full-codegen/full-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698