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

Issue 10537065: Debugger break on TypeError, AssertionError (Closed)

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

Description

Debugger break on TypeError, AssertionError Add debugger functionality to pause the VM whenever a TypeError or AssertionError exception happens. This is a first step towards breaking on handled and unhanded exceptions in general. We first need to generate more debug info for catch handlers so we can determine whether an exception will be handled or not before we unwind the stack to run the catch clauses. Committed: https://code.google.com/p/dart/source/detail?r=8457

Patch Set 1 #

Patch Set 2 : #

Total comments: 8

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+212 lines, -56 lines) Patch
M runtime/bin/dbg_connection.h View 1 2 1 chunk +5 lines, -1 line 0 comments Download
M runtime/bin/dbg_connection.cc View 1 2 5 chunks +60 lines, -17 lines 0 comments Download
M runtime/include/dart_debugger_api.h View 1 2 2 chunks +12 lines, -0 lines 0 comments Download
M runtime/vm/code_generator.cc View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M runtime/vm/debugger.h View 1 2 5 chunks +16 lines, -2 lines 0 comments Download
M runtime/vm/debugger.cc View 1 2 3 chunks +71 lines, -25 lines 0 comments Download
M runtime/vm/debugger_api_impl.cc View 1 2 3 chunks +18 lines, -0 lines 0 comments Download
M runtime/vm/exceptions.cc View 1 2 2 chunks +6 lines, -1 line 0 comments Download
M tools/ddbg.dart View 1 2 2 chunks +21 lines, -7 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
hausner
8 years, 6 months ago (2012-06-07 23:56:16 UTC) #1
siva
lgtm http://codereview.chromium.org/10537065/diff/9001/runtime/vm/debugger.cc File runtime/vm/debugger.cc (right): http://codereview.chromium.org/10537065/diff/9001/runtime/vm/debugger.cc#newcode637 runtime/vm/debugger.cc:637: return class_name.Equals("TypeError") || class_name.Equals("AssertionError"); There may be a ...
8 years, 6 months ago (2012-06-08 17:17:27 UTC) #2
hausner
8 years, 6 months ago (2012-06-08 17:42:35 UTC) #3
Thank you.

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

http://codereview.chromium.org/10537065/diff/9001/runtime/vm/debugger.cc#newc...
runtime/vm/debugger.cc:637: return class_name.Equals("TypeError") ||
class_name.Equals("AssertionError");
That is my end goal. I think it would be nice if users could select from a list
of exceptions, or all handled or unhandled exceptions. That is for a future
checkin. What I have here is good enough for the demo that Lars wants.

On 2012/06/08 17:17:27, asiva wrote:
> There may be a use case to treat these two separately, that is somebody wants
to
> stop only on type errors vs somebody who wants to stop on user introduced
> assertions.

http://codereview.chromium.org/10537065/diff/9001/runtime/vm/exceptions.cc
File runtime/vm/exceptions.cc (right):

http://codereview.chromium.org/10537065/diff/9001/runtime/vm/exceptions.cc#ne...
runtime/vm/exceptions.cc:247: void Exceptions::Throw(const Instance& exception)
{
On 2012/06/08 17:17:27, asiva wrote:
> Isolate* isolate = Isolate::Current();
> if (isolate-debugger()....) {
> .....
> }

Done.

http://codereview.chromium.org/10537065/diff/9001/runtime/vm/exceptions.cc#ne...
runtime/vm/exceptions.cc:252: ThrowExceptionHelper(exception,
Instance::Handle());
On 2012/06/08 17:17:27, asiva wrote:
> Instance::Handle(isolate);

Done.

http://codereview.chromium.org/10537065/diff/9001/tools/ddbg.dart
File tools/ddbg.dart (right):

http://codereview.chromium.org/10537065/diff/9001/tools/ddbg.dart#newcode99
tools/ddbg.dart:99: sendCmd(cmd).then((result) => handleSetBpResponse(result));
It is a todo. I need to implement the API and wire protocol for this first.
That's the next step.

On 2012/06/08 17:17:27, asiva wrote:
> No command to be able to say
> "stop on type errors"
> "stop on assertion errors" etc.
> or is that a TODO for next round of changes.

Powered by Google App Engine
This is Rietveld 408576698