Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger in DartEditor does not show enough information for closure activation on the stack #4768

Closed
larsbak opened this issue Aug 28, 2012 · 13 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. type-enhancement A request for a change that isn't a bug vm-debugger

Comments

@larsbak
Copy link

larsbak commented Aug 28, 2012

In the stack view (attached picture) the line:
    CodeEmitterTask.<anonymous closure>()
fails to show the closure resides inside the assembleProgram method.
How about displaying:
    CodeEmitterTask.assembleProgram.{}()

This will make the context clear.

Regards,
  Lars


Attachment:
DebuggerClosure.png (209.43 KB)

@danrubel
Copy link

Added this to the M1 milestone.
Removed Type-Defect label.
Added Type-Enhancement label.

@devoncarew
Copy link
Member

It sounds like there are two changes here. One is just a change from <anonymous closure> ==> {}. The other is to include the names of the enclosing scopes (CodeEmitterTask.{} ==> CodeEmitterTask.assembleProgram.{}).


Set owner to @mhausner.
Removed Area-Editor label.
Added Area-VM label.

@iposva-google
Copy link
Contributor

Removed the owner.
Removed this from the M1 milestone.
Added this to the M2 milestone.

@iposva-google
Copy link
Contributor

Removed this from the M2 milestone.
Added this to the M3 milestone.

@iposva-google
Copy link
Contributor

Removed this from the M3 milestone.
Added this to the M4 milestone.

@larsbak
Copy link
Author

larsbak commented May 28, 2013

Removed this from the M4 milestone.
Added this to the M5 milestone.

@iposva-google
Copy link
Contributor

Removed Priority-Medium label.
Added Priority-Unassigned label.

@iposva-google
Copy link
Contributor

Removed this from the M5 milestone.

@DartBot
Copy link

DartBot commented Sep 20, 2013

This comment was originally written by @mhausner


Set owner to @mhausner.
Added debugger, Accepted labels.

@DartBot
Copy link

DartBot commented Nov 15, 2013

This comment was originally written by @mhausner


The VM now provides all the additional info. I'll let Devon close this issue once the editor exposes all of it to the user.


Set owner to @devoncarew.

@scheglov
Copy link
Contributor

I don't see VM providing enough info.

Test code:


import 'dart:async';

main() {
  fooBar();
  new A().barBaz();
  new Future(() {
    print('aaa');
  });
}

fooBar() {
  new Future(() {
    print('bbb');
  });
}

class A {
  barBaz() {
    new Future(() {
      print('ccc');
    });
  }
}


Stack trace for breakpoint on print('bbb'), see formatted output as the first attached image.
Note that the first "functionName", in test2.dart is just "<anonymous closure>" without specifying that it is in "main".


[2191.797 <== { "event": "paused", "params": { "reason": "breakpoint", "isolateId": 360142472,"breakpointId": 1,"location": { "url":"file:///Users/scheglov/dart/test2/bin/test2.dart","libraryId":13,"tokenOffset":59}}}]
[2191.797 ==> {"id":9,"command":"getStackTrace","params":{"isolateId":360142472}}]
[2191.800 <== { "id": 9, "result": {"callFrames" : [ {"functionName":"<anonymous closure>","location": { "url":"file:///Users/scheglov/dart/test2/bin/test2.dart","libraryId":13,"tokenOffset":59},"locals":[]},{"functionName":"Future.<anonymous closure>","location": { "url":"dart:async/future.dart","libraryId":7,"tokenOffset":177},"classId":311,"locals":[{"name":":type_arguments","value":{"objectId":0,"kind":"object","text":"null"}},{"name":"result","value":{"objectId":1,"kind":"object","classId":324,"text":"object of type Future"}},{"name":"computation","value":{"objectId":2,"kind":"function","name":"fooBar.<anonymous closure>","signature":"() => dynamic","location": { "url":"file:///Users/scheglov/dart/test2/bin/test2.dart","libraryId":13,"tokenOffset":54}}}]},{"functionName":"Timer.<anonymous closure>","location": { "url":"dart:async-patch/timer_patch.dart","libraryId":7,"tokenOffset":78},"classId":475,"locals":[{"name":"callback","value":{"objectId":3,"kind":"function","name":"Future.Future.<anonymous closure>","signature":"() => dynamic","location": { "url":"dart:async/future.dart","libraryId":7,"tokenOffset":164}}},{"name":"@687914314","value":{"objectId":4,"kind":"object","classId":1109,"text":"object of type _Timer"}}]},{"functionName":"_Timer@497094340.handleTimeout@497094340","location": { "url":"dart:io/timer_impl.dart","libraryId":12,"tokenOffset":1924},"classId":1109,"locals":[{"name":"@497094340","value":{"objectId":0,"kind":"object","text":"null"}},{"name":"currentTime","value":{"objectId":5,"kind":"number","text":"1411852199410"}},{"name":"timer","value":{"objectId":4,"kind":"object","classId":1109,"text":"object of type _Timer"}},{"name":"nextTimer","value":{"objectId":6,"kind":"object","classId":1109,"text":"object of type _Timer"}},{"name":"next","value":{"objectId":7,"kind":"object","classId":1109,"text":"object of type _Timer"}},{"name":"callback","value":{"objectId":8,"kind":"function","name":"Timer._createTimer.<anonymous closure>","signature":"(dynamic) => dynamic","location": { "url":"dart:async-patch/timer_patch.dart","libraryId":7,"tokenOffset":72}}}]},{"functionName":"_RawReceivePortImpl@709387912._handleMessage@709387912","location": { "url":"dart:isolate-patch/isolate_patch.dart","libraryId":1,"tokenOffset":649},"classId":54,"locals":[{"name":"handler","value":{"objectId":9,"kind":"function","name":"_handleTimeout","signature":"(dynamic) => void","location": { "url":"dart:io/timer_impl.dart","libraryId":12,"tokenOffset":1692}}},{"name":"message","value":{"objectId":0,"kind":"object","text":"null"}}]}]}}]


  The same is for A.barBaz().
  See the second attached image.
  Again, we see just "A.<anonymous closure>", but not the name of the method in A where it is, i.e. "A.barBaz.<anonymous closure>".


[2676.875 ==> {"id":11,"command":"getStackTrace","params":{"isolateId":360142472}}]
[2676.879 <== { "id": 11, "result": {"callFrames" : [ {"functionName":"A.<anonymous closure>","location": { "url":"file:///Users/scheglov/dart/test2/bin/test2.dart","libraryId":13,"tokenOffset":88},"classId":1298,"locals":[]},{"functionName":"Future.<anonymous closure>","location": { "url":"dart:async/future.dart","libraryId":7,"tokenOffset":177},"classId":311,"locals":[{"name":":type_arguments","value":{"objectId":0,"kind":"object","text":"null"}},{"name":"result","value":{"objectId":1,"kind":"object","classId":324,"text":"object of type Future"}},{"name":"computation","value":{"objectId":2,"kind":"function","name":"A.barBaz.<anonymous closure>","signature":"() => dynamic","location": { "url":"file:///Users/scheglov/dart/test2/bin/test2.dart","libraryId":13,"tokenOffset":83}}}]},{"functionName":"Timer.<anonymous closure>","location": { "url":"dart:async-patch/timer_patch.dart","libraryId":7,"tokenOffset":78},"classId":475,"locals":[{"name":"callback","value":{"objectId":3,"kind":"function","name":"Future.Future.<anonymous closure>","signature":"() => dynamic","location": { "url":"dart:async/future.dart","libraryId":7,"tokenOffset":164}}},{"name":"@687914314","value":{"objectId":4,"kind":"object","classId":1109,"text":"object of type _Timer"}}]},{"functionName":"_Timer@497094340.handleTimeout@497094340","location": { "url":"dart:io/timer_impl.dart","libraryId":12,"tokenOffset":1924},"classId":1109,"locals":[{"name":"@497094340","value":{"objectId":0,"kind":"object","text":"null"}},{"name":"currentTime","value":{"objectId":5,"kind":"number","text":"1411852199410"}},{"name":"timer","value":{"objectId":4,"kind":"object","classId":1109,"text":"object of type _Timer"}},{"name":"nextTimer","value":{"objectId":6,"kind":"object","classId":1109,"text":"object of type _Timer"}},{"name":"next","value":{"objectId":6,"kind":"object","classId":1109,"text":"object of type _Timer"}},{"name":"callback","value":{"objectId":7,"kind":"function","name":"Timer._createTimer.<anonymous closure>","signature":"(dynamic) => dynamic","location": { "url":"dart:async-patch/timer_patch.dart","libraryId":7,"tokenOffset":72}}}]},{"functionName":"_RawReceivePortImpl@709387912._handleMessage@709387912","location": { "url":"dart:isolate-patch/isolate_patch.dart","libraryId":1,"tokenOffset":649},"classId":54,"locals":[{"name":"handler","value":{"objectId":8,"kind":"function","name":"_handleTimeout","signature":"(dynamic) => void","location": { "url":"dart:io/timer_impl.dart","libraryId":12,"tokenOffset":1692}}},{"name":"message","value":{"objectId":0,"kind":"object","text":"null"}}]}]}}]



Attachments:
[Screen Shot 2014-09-27 at 2.15.50 PM.png](https://storage.googleapis.com/google-code-attachments/dart/issue-4768/comment-11/Screen Shot 2014-09-27 at 2.15.50 PM.png) (312.56 KB)
[Screen Shot 2014-09-27 at 2.19.02 PM.png](https://storage.googleapis.com/google-code-attachments/dart/issue-4768/comment-11/Screen Shot 2014-09-27 at 2.19.02 PM.png) (313.55 KB)


Removed the owner.
Removed Type-Enhancement label.
Added Type-Defect, Triaged labels.

@DartBot
Copy link

DartBot commented Sep 29, 2014

This comment was originally written by @mhausner


My comment #­10 is referring to closure objects, not function/closure names. This is still a valid feature wish.


Removed Type-Defect label.
Added Type-Enhancement, Accepted labels.

@larsbak larsbak added Type-Enhancement area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. vm-debugger labels Sep 29, 2014
@iposva-google
Copy link
Contributor

Editor is not supported any more.

@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. type-enhancement A request for a change that isn't a bug vm-debugger
Projects
None yet
Development

No branches or pull requests

7 participants