PyDev.Debugger icon indicating copy to clipboard operation
PyDev.Debugger copied to clipboard

Load a trace for post mortem debugging

Open c1728p9 opened this issue 10 years ago • 3 comments

Is it possible to load a trace with PyDev? Something similar to pdb's post_mortem(traceback) function? If not, would it be hard to add?

c1728p9 avatar May 31 '15 20:05 c1728p9

It should work already if you have an exception (PyDev already does post-mortem handling of unhandled exceptions by replacing the except hook).

Albeit to work programatically, you need to access some protected APIs (you could take a look at those and do what they do internally directly -- shouldn't be hard):

import pydevd pydevd._set_pm_excepthook() pydevd._excepthook(exctype, value, tb)

fabioz avatar May 31 '15 23:05 fabioz

Thanks for the help. I gave this a try but was unable to get the callstack to display correctly. I was able to get the calls to work by importing them directly from from pydevd_breakpoints (the wildcard import in pydevd didn't import the private functions), but nothing new got displayed in eclipse. Does anything special need to be done when loading through eclipse? Also, is it possible to load only the traceback without exctype and value, so the interface can be the same as PDB?

c1728p9 avatar Jun 01 '15 02:06 c1728p9

Hi, is there an update on this? Those internal APIs do not seem to exist anymore. I also tried what's propsed in #53 but it seems it needs some internal thread objects.

iwanb avatar Feb 16 '21 18:02 iwanb