A report could be left empty: sampling thread stacks signals every
thread, and a debugger such as gdb stops the whole process on that
signal before anything is written. Debugger pauses also looked like
hangs, so resuming from a breakpoint produced a false report whose
sampling froze the app again.
The summary (phase, open scopes, input events) and application files
are now written first, before any sampling. Sampling is skipped while a
debugger is attached, and the report says so. When the watchdog's own
100 ms wait takes a second or more, the whole process was paused, and
that time no longer counts towards the stalled phase.
The input loop now counts handled events per phase, so a report shows
when the UI thread kept processing a stream of events without ever
leaving input handling. The watchdog clock is injectable for tests.