trepan

getting the C python exec argument string or accessing the evaluation stack

ε祈祈猫儿з 提交于 2020-01-13 06:34:49
问题 In my python debugger I have a way of remapping a string to a filename so that when you are stepping through an exec'd function inside the debugger you can list lines pygmentized, or view them along inside an editor like Emacs via realgud. So I'd like to be able to extract the string in an exec statement when CPython is stopped inside evaluating that. I already have a mechanism that can look back in the call frame to see if the caller was an EXEC_STMT and I can look back one instruction to

getting the C python exec argument string or accessing the evaluation stack

一个人想着一个人 提交于 2019-12-04 19:24:26
In my python debugger I have a way of remapping a string to a filename so that when you are stepping through an exec'd function inside the debugger you can list lines pygmentized, or view them along inside an editor like Emacs via realgud . So I'd like to be able to extract the string in an exec statement when CPython is stopped inside evaluating that. I already have a mechanism that can look back in the call frame to see if the caller was an EXEC_STMT and I can look back one instruction to see if the previous instruction was say DUP_TOP . So I'd be home free if I could just figure out a way