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

Issue 10407071: Introduce remote objects in Debugger protocol (Closed)

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

Description

Introduce remote objects in Debugger protocol Committed: https://code.google.com/p/dart/source/detail?r=7864

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 22

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+476 lines, -62 lines) Patch
M runtime/bin/dbg_connection.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/bin/dbg_connection.cc View 1 2 3 7 chunks +154 lines, -3 lines 0 comments Download
M runtime/include/dart_debugger_api.h View 1 2 3 3 chunks +56 lines, -0 lines 0 comments Download
M runtime/vm/class_table.h View 1 2 3 1 chunk +5 lines, -2 lines 0 comments Download
M runtime/vm/debugger.h View 1 2 3 5 chunks +8 lines, -3 lines 0 comments Download
M runtime/vm/debugger.cc View 1 2 3 11 chunks +73 lines, -13 lines 0 comments Download
M runtime/vm/debugger_api_impl.cc View 1 2 3 3 chunks +67 lines, -0 lines 0 comments Download
M tools/ddbg.dart View 1 2 3 9 chunks +111 lines, -41 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
hausner
8 years, 7 months ago (2012-05-21 23:45:39 UTC) #1
siva
LGTM http://codereview.chromium.org/10407071/diff/11002/runtime/bin/dbg_connection.cc File runtime/bin/dbg_connection.cc (right): http://codereview.chromium.org/10407071/diff/11002/runtime/bin/dbg_connection.cc#newcode133 runtime/bin/dbg_connection.cc:133: return atoi(r.ValueChars()); It might be safer to use ...
8 years, 7 months ago (2012-05-22 01:49:09 UTC) #2
hausner
8 years, 7 months ago (2012-05-22 18:03:57 UTC) #3
http://codereview.chromium.org/10407071/diff/11002/runtime/bin/dbg_connection.cc
File runtime/bin/dbg_connection.cc (right):

http://codereview.chromium.org/10407071/diff/11002/runtime/bin/dbg_connection...
runtime/bin/dbg_connection.cc:133: return atoi(r.ValueChars());
On 2012/05/22 01:49:09, asiva wrote:
> It might be safer to use strtol here as it checks for overflow and underflow

Done.

http://codereview.chromium.org/10407071/diff/11002/runtime/include/dart_debug...
File runtime/include/dart_debugger_api.h (right):

http://codereview.chromium.org/10407071/diff/11002/runtime/include/dart_debug...
runtime/include/dart_debugger_api.h:27: * Caches a given \object and returns an
object id. The cache is only
On 2012/05/22 01:49:09, asiva wrote:
> This object id is valid only while the VM is paused as the cache is destroyed
> when execution is resumed.

Done.

http://codereview.chromium.org/10407071/diff/11002/runtime/include/dart_debug...
runtime/include/dart_debugger_api.h:306: * Returns in \class_id the class id of
the given \object.
On 2012/05/22 01:49:09, asiva wrote:
> Should you put in some wording that the class id is valid even after execution
> resumes and is valid until the isolate is shutdown.

Done.

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

http://codereview.chromium.org/10407071/diff/11002/runtime/vm/debugger.cc#new...
runtime/vm/debugger.cc:30: RawObject* GetObj(intptr_t obj_id);
On 2012/05/22 01:49:09, asiva wrote:
> const?

Done.

http://codereview.chromium.org/10407071/diff/11002/runtime/vm/debugger_api_im...
File runtime/vm/debugger_api_impl.cc (right):

http://codereview.chromium.org/10407071/diff/11002/runtime/vm/debugger_api_im...
runtime/vm/debugger_api_impl.cc:51: return -1;
On 2012/05/22 01:49:09, asiva wrote:
> Since this is part of the API it might be better to have a named constant for
> -1.
I'd rather solve this by documenting that -1 is an error value, similar to file
handles in Unix/Posix.

http://codereview.chromium.org/10407071/diff/11002/runtime/vm/debugger_api_im...
runtime/vm/debugger_api_impl.cc:393: UNWRAP_AND_CHECK_PARAM(Instance, obj,
object_in);
On 2012/05/22 01:49:09, asiva wrote:
>   if (class_id == NULL) {
>     return Api::NewError("%s expects argument 'class_id' to be non-null.",
>                          CURRENT_FUNC);
>   }
>   *class_id = Class::Handle(....);

It's kind of non-sensical to call this function with a NULL class_id, but is it
an error? Done.

http://codereview.chromium.org/10407071/diff/11002/runtime/vm/debugger_api_im...
runtime/vm/debugger_api_impl.cc:439: }
Not in this case. I want the caller to be able to get only part of the info. For
example, retrieving the static field values is an expensive operation. If the
caller isn't interested in the fields, it saves time and memory when passing
NULL for that parameter.

On 2012/05/22 01:49:09, asiva wrote:
> Ditto Api::NewError return values here for NULL pointer values....

http://codereview.chromium.org/10407071/diff/11002/tools/ddbg.dart
File tools/ddbg.dart (right):

http://codereview.chromium.org/10407071/diff/11002/tools/ddbg.dart#newcode36
tools/ddbg.dart:36: po <id> Print object
On 2012/05/22 01:49:09, asiva wrote:
> missing help for command 'pc' ?
> 
> Also noticed 'h' is not listed here.

Done.

http://codereview.chromium.org/10407071/diff/11002/tools/ddbg.dart#newcode150
tools/ddbg.dart:150: assert(fields != null);
On 2012/05/22 01:49:09, asiva wrote:
> Just curious, what is the point of this assert, woudn't we get a
> NullPointerException anyway if it turns out to be null.

I guess so. Old C++ habits...

http://codereview.chromium.org/10407071/diff/11002/tools/ddbg.dart#newcode151
tools/ddbg.dart:151: assert(fields is List);
On 2012/05/22 01:49:09, asiva wrote:
> Also what is the style here? instead of adding our own type check asserts in
> this case does it make sense to code as:
> List fields = props["fields"];

This is my early code in which I was experimenting. Cleaning it up.

http://codereview.chromium.org/10407071/diff/11002/tools/ddbg.dart#newcode235
tools/ddbg.dart:235: assert(locals is List);
On 2012/05/22 01:49:09, asiva wrote:
> Ditto question about explicit type check assert.

Done.

Powered by Google App Engine
This is Rietveld 408576698