Is there a way to see the call stack while debugging python in Pydev?
View the call stack while in the debugger While debugging, in the Debug menu, select Windows > Call Stack or press ctrl + alt + C . A yellow arrow identifies the stack frame where the execution pointer is currently located.
To display the call stack window you must first start your code in debug mode. Either start your application using the Step Into command or use a breakpoint to halt execution. You can then show the window by opening the "Debug" menu, expanding its "Windows" submenu and selecting "Call Stack".
The call stack is a list of all the active functions that have been called to get to the current point of execution. The call stack includes an entry for each function called, as well as which line of code will be returned to when the function returns.
This is the "Debug" view of the "Debug" perspective :
You can see that I was inside a failUnlessEqual
method, called by test_01a
, called by a new_method
...
To have the complete stacktrace you could add the following watch expression:
[stackLine for stackLine in __import__("traceback").format_stack() if not 'pydev' in stackLine]
I am not sure if there is a better way to have the complete stacktrace...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With