Do not break on exceptions thrown in undebuggable code if caught in undebuggable code
- Lingua principale
- Dart
- Stelle
- 1.7k
- Fork
- 404
- Merge medio
- 6g 17h
- PR unite (30g)
- 18
Descrizione
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.
https://github.com/dart-lang/sdk/issues/52615
https://github.com/dart-lang/sdk/issues/52423
I proposed that, by default, if an exception is thrown in code that is not debuggable and will be caught in code that is not debuggable, then the debugger will not break even if "Break on all exceptions" is enabled.
For example:
```dart
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 throw and caught in undebuggable code i.e. it is just an implementation detail of `bar`.
Another example:
```dart
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.
This UX will require VM changes.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Start by reviewing the Dart VM debugger's handling of "Break on all exceptions" for throws and catches in debuggable versus undebuggable code. Use the two examples in the issue as behavioral cases: exceptions handled entirely in undebuggable code should not break, while exceptions caught in user code should still break; coordinate the required VM changes and verification.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- dart
- Ambito
- devtools
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 30/100