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

"break methodname" doesn't work consistently for async functions #28561

Closed
jensjoha opened this issue Jan 30, 2017 · 2 comments
Closed

"break methodname" doesn't work consistently for async functions #28561

jensjoha opened this issue Jan 30, 2017 · 2 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. vm-debugger

Comments

@jensjoha
Copy link
Contributor

If I have an async function "xyz" that hasn't been compilede yet, I can add a breakpoint by saying "break xyz" - I will get a message saying something like "Future breakpoint 1 added at file.dart:1:1". And it works and everything's fine.

Once the function has been compiled though (e.g. if I wait until I am actually stepping in the method "xyz"), saying "break xyz" gives me the message "Unable to set breakpoint at xyz".

It seems to be caused by all functions being "debuggable" until proven otherwise, i.e. in case 1 above it's debuggable. The the function is compiled it's set as not debuggable because it's async (case 2 above).

@jensjoha jensjoha added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. vm-debugger labels Jan 30, 2017
@zichangg
Copy link
Contributor

After testing, It will not allowed to set breakpoints in both cases. It is uniform now and case will be closed.

@jensjoha
Copy link
Contributor Author

I would certainly have hoped for a different solution.
While "consistency" is nice, we also have to think of the user. As a user of the debugger, I would certainly expect to be able to break on a method - whether it's async or not.

And "uniform" is only in these two cases - for a non-async method we can still say "break methodName".
Can't we add that for all cases? So that is one says "break asyncMethodName" it automatically "redirects" to the async_op inner-function?

@jensjoha jensjoha reopened this Feb 26, 2019
dart-bot pushed a commit that referenced this issue Jul 2, 2019
In observatory, "Break <function name>" will add a breakpoint at the beginning of function. But it will reject if <function name> is an async function, as it is not debuggable.
Add checks for async function will allow breakpoint to set. Once async_op is compiled, breakpoint will be resolved correctly.

Bug: #28561
Change-Id: I37cf6a05c54b6a0062845926f4f3b85557dcc52a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107522
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
@zichangg zichangg closed this as completed Jul 3, 2019
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, and the AOT and JIT backends. vm-debugger
Projects
None yet
Development

No branches or pull requests

2 participants