Open utterances-bot opened 1 month ago
Hi, I guess it really depends on the interpreter but in most of them it should be a matter of 1) finding a place to stop at, and 2) finding a way/API to execute code from a string. Probably as long as we are not talking about JITted code.
Regarding tracing C calls, this is possible in multiple ways:
ltrace
could be used for tracing library functions (well, with modern security mitigations -- relocations read-only and bind now -- ltrace often fails and do not work, but it could be fixed...) dprintf <location> <fmtstr>, <args>
command in GDB)However, keep in mind that it may not be possible to trace all of the functions since, e.g., functions defined with static
keyword are often inlined etc.
Debugging running Python scripts with PDB via GDB
Disconnect3d's blog.
http://disconnect3d.pl//2024/08/04/debugging-cpython-live/