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

Issue 9706038: Fix breakpoint location (Closed)

Created:
8 years, 9 months ago by hausner
Modified:
8 years, 9 months ago
Reviewers:
srdjan
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Fix breakpoint location The debugger code erroneously assumed that PC descriptors are sorted by ascending token_index. That is not the case. This change fixes the translation from token index to pc descriptor index. Committed: https://code.google.com/p/dart/source/detail?r=5496

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -16 lines) Patch
M runtime/vm/debugger.cc View 2 chunks +26 lines, -16 lines 2 comments Download

Messages

Total messages: 3 (0 generated)
hausner
8 years, 9 months ago (2012-03-14 22:32:20 UTC) #1
srdjan
LGTM http://codereview.chromium.org/9706038/diff/1/runtime/vm/debugger.cc File runtime/vm/debugger.cc (right): http://codereview.chromium.org/9706038/diff/1/runtime/vm/debugger.cc#newcode548 runtime/vm/debugger.cc:548: if (desc_token_index < token_index) { You are searching ...
8 years, 9 months ago (2012-03-14 22:47:43 UTC) #2
hausner
8 years, 9 months ago (2012-03-14 23:10:25 UTC) #3
Thank you!

http://codereview.chromium.org/9706038/diff/1/runtime/vm/debugger.cc
File runtime/vm/debugger.cc (right):

http://codereview.chromium.org/9706038/diff/1/runtime/vm/debugger.cc#newcode548
runtime/vm/debugger.cc:548: if (desc_token_index < token_index) {
On 2012/03/14 22:47:43, srdjan wrote:
> You are searching for closest token after 'token_index', why not for closest
> token ? -> abs(desc_token_index - token_index).
> 
> You could also stop if best_fit == 0.

The token index just before the requested index location is probably on the
previous line, not the one that was requested by the user. 

Yes, I could stop if the match is perfect, but that is almost never going to
happen. The token_index that is passed in represents the first token on a given
source line. That token is probably never a function call. So checking that
additional condition will cost more than it saves.

Powered by Google App Engine
This is Rietveld 408576698