mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-107758: Improvements to lltrace feature (#107757)
- The `dump_stack()` method could call a `__repr__` method implemented in Python, causing (infinite) recursion. I rewrote it to only print out the values for some fundamental types (`int`, `str`, etc.); for everything else it just prints `<type_name @ 0xdeadbeef>`. - The lltrace-like feature for uops wrote to `stderr`, while the one in `ceval.c` writes to `stdout`; I changed the uops to write to stdout as well.
This commit is contained in:
parent
2df58dcd50
commit
328d925244
4 changed files with 32 additions and 9 deletions
|
@ -41,7 +41,7 @@ _PyUopExecute(_PyExecutorObject *executor, _PyInterpreterFrame *frame, PyObject
|
|||
lltrace = *uop_debug - '0'; // TODO: Parse an int and all that
|
||||
}
|
||||
#define DPRINTF(level, ...) \
|
||||
if (lltrace >= (level)) { fprintf(stderr, __VA_ARGS__); }
|
||||
if (lltrace >= (level)) { printf(__VA_ARGS__); }
|
||||
#else
|
||||
#define DPRINTF(level, ...)
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue