Skip to content

Do not break on exceptions thrown in undebuggable code if caught in undebuggable code #53755

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

Open
brianquinlan opened this issue Oct 13, 2023 · 0 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. P3 A lower priority bug or feature request triaged Issue has been triaged by sub team vm-debugger

Comments

@brianquinlan
Copy link
Contributor

See flutter/devtools#5883 for discussion.

There are several issues where users were confused by the the "Break on all exceptions" option when an exception is thrown in core library code and handled in core library code, e.g.
#52615
#52423

If an exception is thrown in code that is not debuggable and will be caught in code that is not debuggable, then the debugger should not break even if "Break on all exceptions" is enabled.

For example:

part of dart.core

void _foo() {
  throw Exception('foo');
}

void bar() {
  try {
   _foo();
  } on Exception {};
}

Calling bar should not cause the debugger to break on throw Exception('foo'); because the exception is both thrown and caught in undebuggable code i.e. it is just an implementation detail of bar.

Another example:

part of dart.core

void _foo() {
  throw Exception('foo');
}

void bar() {
   _foo();
}

// User code:
void main() {
  try {
    bar();
  } on Exception {}
}

Calling bar should cause the debugger to break on throw Exception('foo'); because the exception is caught in debuggable code.

@lrhn lrhn added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Oct 21, 2023
@a-siva a-siva added P3 A lower priority bug or feature request triaged Issue has been triaged by sub team labels Nov 9, 2023
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. P3 A lower priority bug or feature request triaged Issue has been triaged by sub team vm-debugger
Projects
None yet
Development

No branches or pull requests

4 participants