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

Issue 9668036: Teach debugger to ignore breakpoints (Closed)

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

Description

Teach debugger to ignore breakpoints Reentrant debugger calls to fetch values may execute dart code as a side effect. Teach the debugger to ignore any breakpoints it might hit while doing so. Committed: https://code.google.com/p/dart/source/detail?r=5274

Patch Set 1 #

Total comments: 13
Unified diffs Side-by-side diffs Delta from patch set Stats (+208 lines, -20 lines) Patch
M runtime/vm/debugger.h View 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/debugger.cc View 8 chunks +17 lines, -6 lines 3 comments Download
M runtime/vm/debugger_api_impl_test.cc View 13 chunks +183 lines, -12 lines 10 comments Download
M runtime/vm/debugger_x64.cc View 1 chunk +3 lines, -2 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
hausner
The actual functional change is tiny.
8 years, 9 months ago (2012-03-09 23:24:13 UTC) #1
siva
LGTM. There is also the case of ignoring breakpoints when stepping over a recursive function ...
8 years, 9 months ago (2012-03-10 00:11:40 UTC) #2
hausner
Thank you. http://codereview.chromium.org/9668036/diff/1/runtime/vm/debugger.cc File runtime/vm/debugger.cc (right): http://codereview.chromium.org/9668036/diff/1/runtime/vm/debugger.cc#newcode687 runtime/vm/debugger.cc:687: ignore_breakpoints_ = saved_ignore_flag; On 2012/03/10 00:11:40, asiva ...
8 years, 9 months ago (2012-03-10 00:41:56 UTC) #3
siva
http://codereview.chromium.org/9668036/diff/1/runtime/vm/debugger.cc File runtime/vm/debugger.cc (right): http://codereview.chromium.org/9668036/diff/1/runtime/vm/debugger.cc#newcode687 runtime/vm/debugger.cc:687: ignore_breakpoints_ = saved_ignore_flag; Sounds like premature optimization :-) On ...
8 years, 9 months ago (2012-03-12 22:19:14 UTC) #4
hausner
8 years, 9 months ago (2012-03-12 22:36:44 UTC) #5
http://codereview.chromium.org/9668036/diff/1/runtime/vm/debugger_api_impl_te...
File runtime/vm/debugger_api_impl_test.cc (right):

http://codereview.chromium.org/9668036/diff/1/runtime/vm/debugger_api_impl_te...
runtime/vm/debugger_api_impl_test.cc:383: Dart_SetStepInto();
The relevant case that we test here happens when we step into the getter
function get:i of class B. The easiest way to get a breakpoint inside the getter
is to stop at main, and then step into every function call.

On 2012/03/12 22:19:14, asiva wrote:
> Not sure I understand what you mean by get into every function.
> 
> On 2012/03/10 00:41:56, hausner wrote:
> > On 2012/03/10 00:11:40, asiva wrote:
> > > Why is it necessary to single step after this?
> > It's just the easiest way to make sure we get into every function.
>

http://codereview.chromium.org/9668036/diff/1/runtime/vm/debugger_api_impl_te...
runtime/vm/debugger_api_impl_test.cc:412: breakpoint_hit_counter = 0;
This test hits many breakpoints (including the internal ones that are the result
of stepping):

Running test: Debug_IgnoreBP
>>> Breakpoint nr. 0 in function main (dart:test-lib:9) <<<
    function main
      local var x = null
>>> Breakpoint nr. 1 in function B.B. (dart:test-lib:1) <<<
    function B.B.
      local var this = object of type 'Library:'dart:test-lib' Class: B'
        field i = 100
        field d = 3.14
        field s = "Dr Seuss"
        static field z = 0
    function main
      local var x = null
>>> Breakpoint nr. 2 in function Object.Object. (bootstrap:668) <<<
    function Object.Object.
      local var this = object of type 'Library:'dart:test-lib' Class: B'
        field i = 100
        field d = 3.14
        field s = "Dr Seuss"
        static field z = 0
    function B.B.
      local var this = object of type 'Library:'dart:test-lib' Class: B'
        field i = 100
        field d = 3.14
        field s = "Dr Seuss"
        static field z = 0
    function main
      local var x = null
>>> Breakpoint nr. 3 in function B.B. (dart:test-lib:1) <<<
    function B.B.
      local var this = object of type 'Library:'dart:test-lib' Class: B'
        field i = 100
        field d = 3.14
        field s = "Dr Seuss"
        static field z = 0
    function main
      local var x = null
>>> Breakpoint nr. 4 in function main (dart:test-lib:10) <<<
    function main
      local var x = object of type 'Library:'dart:test-lib' Class: B'
        field i = 100
        field d = 3.14
        field s = "Dr Seuss"
        static field z = 0
>>> Breakpoint nr. 5 in function B.get:i (dart:test-lib:3) <<<
    function B.get:i
      local var this = object of type 'Library:'dart:test-lib' Class: B'
        field i = 100
        field d = 3.14
        field s = "Dr Seuss"
        static field z = 0
    function main
      local var x = object of type 'Library:'dart:test-lib' Class: B'
        field i = 100
        field d = 3.14
        field s = "Dr Seuss"
        static field z = 0
>>> Breakpoint nr. 6 in function main (dart:test-lib:10) <<<
    function main
      local var x = object of type 'Library:'dart:test-lib' Class: B'
        field i = 100
        field d = 3.14
        field s = "Dr Seuss"
        static field z = 0
>>> Breakpoint nr. 7 in function IntegerImplementation.+ (bootstrap_impl:1441)
<<<
    function IntegerImplementation.+
      local var this = 100
      local var other = 1
    function main
      local var x = object of type 'Library:'dart:test-lib' Class: B'
        field i = 100
        field d = 3.14
        field s = "Dr Seuss"
        static field z = 0
>>> Breakpoint nr. 8 in function IntegerImplementation.addFromInteger
(bootstrap_impl:1483) <<<
    function IntegerImplementation.addFromInteger
      local var this = 1
      local var other = 100
    function IntegerImplementation.+
      local var this = 100
      local var other = 1
    function main
      local var x = object of type 'Library:'dart:test-lib' Class: B'
        field i = 100
        field d = 3.14
        field s = "Dr Seuss"
        static field z = 0
>>> Breakpoint nr. 9 in function IntegerImplementation.+ (bootstrap_impl:1441)
<<<
    function IntegerImplementation.+
      local var this = 100
      local var other = 1
    function main
      local var x = object of type 'Library:'dart:test-lib' Class: B'
        field i = 100
        field d = 3.14
        field s = "Dr Seuss"
        static field z = 0
>>> Breakpoint nr. 10 in function main (dart:test-lib:10) <<<
    function main
      local var x = object of type 'Library:'dart:test-lib' Class: B'
        field i = 100
        field d = 3.14
        field s = "Dr Seuss"
        static field z = 0
Done: Debug_IgnoreBP


On 2012/03/12 22:19:14, asiva wrote:
> If you are retaining it then why not add the check
> EXPECT_EQ(1, breakpoint_hit_counter);
> 
> On 2012/03/10 00:41:56, hausner wrote:
> > It's just boilerplate that I copied from other test cases. I could eliminate
> it,
> > but then, there's no harm in leaving it.
> > 
> > On 2012/03/10 00:11:40, asiva wrote:
> > > What is the significance of breakpoint_hit_counter in this test as you are
> not
> > > checking the value with any EXPECT clause.
> > > 
> > > Maybe there should be a EXPECT_EQ(1, breakpoint_hit_counter);
> > 
>

Powered by Google App Engine
This is Rietveld 408576698