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

Issue 8775060: Debugger step 2 (Closed)

Created:
9 years ago by hausner
Modified:
9 years ago
Reviewers:
siva
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Debugger step 2 Add ActivationFrame and StackTrace classes. Add Breakpoint info: url and line number. Fix breakpoint stub so breakpoints don't get patched over by PatchStaticCall Committed: https://code.google.com/p/dart/source/detail?r=2089

Patch Set 1 #

Total comments: 16

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+335 lines, -49 lines) Patch
M runtime/vm/code_generator.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/code_generator.cc View 1 2 chunks +22 lines, -13 lines 0 comments Download
M runtime/vm/code_generator_ia32.cc View 1 2 chunks +2 lines, -0 lines 0 comments Download
M runtime/vm/debugger.h View 1 2 chunks +94 lines, -0 lines 0 comments Download
M runtime/vm/debugger.cc View 1 8 chunks +204 lines, -29 lines 0 comments Download
M runtime/vm/stub_code_ia32.cc View 1 2 chunks +11 lines, -6 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
hausner
9 years ago (2011-12-02 18:57:17 UTC) #1
hausner
Ping...
9 years ago (2011-12-05 17:40:44 UTC) #2
siva
lgtm http://codereview.chromium.org/8775060/diff/1/runtime/vm/debugger.cc File runtime/vm/debugger.cc (right): http://codereview.chromium.org/8775060/diff/1/runtime/vm/debugger.cc#newcode41 runtime/vm/debugger.cc:41: ASSERT(this->token_index_ != 0); Storing the pc_ and token_index_ ...
9 years ago (2011-12-05 19:21:44 UTC) #3
hausner
9 years ago (2011-12-05 21:11:23 UTC) #4
Thanks Siva.

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

http://codereview.chromium.org/8775060/diff/1/runtime/vm/debugger.cc#newcode41
runtime/vm/debugger.cc:41: ASSERT(this->token_index_ != 0);
On 2011/12/05 19:21:44, asiva wrote:
> Storing the pc_ and token_index_ in this structure seems to un-normalize the
> data somewhat. Why is it not sufficient to just store the func object and
> pc_desc_index? Are you worried that the cost of accessing the pc_ and
> token_index_ using the pc_descriptors array would be very high?

I tried to cache some data so it would not have to be computed each time. (Even
just getting the token index requires allocating handles.) Also, I have to get
the code and pc descriptors anyway to get the PC. Why duplicate that code
pattern in an accessor for token_index?

If you feel strongly I can remove token_index_ though.

http://codereview.chromium.org/8775060/diff/1/runtime/vm/debugger.cc#newcode131
runtime/vm/debugger.cc:131: }
On 2011/12/05 19:21:44, asiva wrote:
> The line number computation code is duplicated here and above maybe it can be
> factored into a single function intptr_t ComputeLineNumber(script,
token_index);

I noticed that too, but I could really only factor out the call to
GetTokenLocation. I'm not sure that's really an abstraction. In a way,
GetTokenLocation is the factored-out code here.

http://codereview.chromium.org/8775060/diff/1/runtime/vm/debugger.cc#newcode281
runtime/vm/debugger.cc:281: for (int i = 0; i < stack->Length(); i++) {
On 2011/12/05 19:21:44, asiva wrote:
> stack->Length() returns an intptr_t so should i also be an intptr_t?

Done.

http://codereview.chromium.org/8775060/diff/1/runtime/vm/debugger.cc#newcode313
runtime/vm/debugger.cc:313: }
On 2011/12/05 19:21:44, asiva wrote:
> Why not register DefaultBreakpointHandler as the default handler in
> Debugger::Initialize() and
> ASSERT(bp_handler_ != NULL); here.

Yes. Done.

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

http://codereview.chromium.org/8775060/diff/1/runtime/vm/debugger.h#newcode26
runtime/vm/debugger.h:26: RawScript* SourceCode();
On 2011/12/05 19:21:44, asiva wrote:
> const?

Can't be const because it's not initialized in the constructor.

http://codereview.chromium.org/8775060/diff/1/runtime/vm/debugger.h#newcode27
runtime/vm/debugger.h:27: RawString* SourceUrl();
On 2011/12/05 19:21:44, asiva wrote:
> const?

ditto.

http://codereview.chromium.org/8775060/diff/1/runtime/vm/debugger.h#newcode59
runtime/vm/debugger.h:59: intptr_t TokenIndex();
On 2011/12/05 19:21:44, asiva wrote:
> above 4 methods can be 'const'?

Unfortunately not. DartFunction() assigns to a field in ActivationFrame. The
other functions call DartFunction. It's the price to pay for lazy evaluation.

http://codereview.chromium.org/8775060/diff/1/runtime/vm/debugger.h#newcode61
runtime/vm/debugger.h:61: char* ToCString();
On 2011/12/05 19:21:44, asiva wrote:
> 'const'?

const char* as the return type? Yes. Done. The function itself cannot be const
because it calls DartFunction().

Powered by Google App Engine
This is Rietveld 408576698