Full stack trace in pdb.post_mortem() ?
I'm trying to understand pdb.post_mortem(), and why the backtrace
available in the debugger session seems limited.
I posted a similar question on stackoverflow, but figured I'd try
here as well.
Here's a simple program
raise Exception("bad stuff")
except Exception as ex:
# using breakpoint() gives the full stack trace, of course
When I run that, I get put in the debugger.
Then, if I run the `bt` command to get a backtrace, I see:
-> raise Exception("bad stuff")
As you can see, the backtrace only has `outer()` and `inner()`.
What happened to `main()`? I want the full stack available, so I can
investigate variables, etc. at any point along the chain.
(in a real example, there might be quite a lot of additional call
frames of interest)
For this contrived example, I can put `breakpoint()` instead of
`post_mortem()`, and get what I want.
But I feel like I'm misunderstanding post-mortem debugging.
Is the full call stack simply not available?
Note: I am aware that I can *print* the full stack trace (including
`main()`), even if it takes some special effort. See these posts: