Interested in support to jump between chained exception in Pdb

Is there any interest/plan for chained exception in Pdb ?
That is to say if you have

try:
   function_that_raises()
except Exception as e:
   raise ...  from e  # Pdb says this is the bottom frame.

Havin something like down go down the chained exception ? This was requested on IPython’s ipdb, But I believe this could be brought to Pdb as well.

How

When moving up and down the stack in Pdb in chained exception, when hitting the bottom of the stack, it should be possible to look at the __cause__ or __context__ and jump to the top of it. And vice-versa when going up if we store the various TB we went through.

In post-mortem debugging this should allow to better understand the reason for an exception.

I believe up/down are fairly natural commands to do so, but open to other ways.

1 Like

I’m too tired to help, but in principle this sounds like a useful thing to add. Go for it!

Thanks you very much for the feedback. I believe I should be able to manage at least a POC and a PR by myself.

I will open an issue on the GH bug tracker, and start working on a PR.