- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have recently noticed that when I have a derived type with a "final" procedure, and I am debugging line by line with F11, when the instance of the derived type moves out of scope at the relevant "end subroutine" statement, the debugger just jumps to the next statement after the original "call", when I would really like it to (i.e. expect it to) jump to the first statement in the final procedure.
Now that I know this is what will happen I can put a break point in the final procedure, and that does work, but I do wonder if this is a "feature" of debugging that has been overlooked, or at least not documented very well.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From the debugger's viewpoint, it is doing what you asked. The finalization is part of the scope exit code, not the next statement. Setting a breakpoint in the final routine is what you'd need to do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the debugger in VS on Windows: F11 is "step into", and F10 is "step over".
I would like and expect F11 to visit every line of my source code that gets executed.
I agree with Steve's response, had I been hitting F10 and sat at the end subroutine statement.
Just a thought (or is it a terrible warning?)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You would need to be in assembly view, I think, to step into finalization and even then you'd first enter a library routine which, after a while, calls the finalizer.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page