diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2022-05-11 20:15:30 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2022-05-12 08:00:03 -0400 |
commit | 9097c0dd319d370925a8a4f65da89e19c8cddd65 (patch) | |
tree | 205036e2264d7c71835443391d54c929b58d221d | |
parent | 45ba7e7cd0ba0b121043541dee4f9e4f7bc98dc4 (diff) | |
download | python-coveragepy-git-9097c0dd319d370925a8a4f65da89e19c8cddd65.tar.gz |
debug: incidental debug improvements in tracer.c
-rw-r--r-- | coverage/ctracer/tracer.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/coverage/ctracer/tracer.c b/coverage/ctracer/tracer.c index fc88ef85..80d24b3f 100644 --- a/coverage/ctracer/tracer.c +++ b/coverage/ctracer/tracer.c @@ -119,6 +119,10 @@ CTracer_dealloc(CTracer *self) } #if TRACE_LOG +/* Set debugging constants: a file substring and line number to start logging. */ +static const char * start_file = "badasync.py"; +static int start_line = 1; + static const char * indent(int n) { @@ -132,9 +136,6 @@ indent(int n) } static BOOL logging = FALSE; -/* Set these constants to be a file substring and line number to start logging. */ -static const char * start_file = "nested.py"; -static int start_line = 1; static void CTracer_showlog(CTracer * self, int lineno, PyObject * filename, const char * msg) @@ -787,11 +788,13 @@ CTracer_trace(CTracer *self, PyFrameObject *frame, int what, PyObject *arg_unuse #endif #if WHAT_LOG + const char * w = "XXX "; if (what <= (int)(sizeof(what_sym)/sizeof(const char *))) { - ascii = PyUnicode_AsASCIIString(MyFrame_GetCode(frame)->co_filename); - printf("%x trace: f:%x %s @ %s %d\n", (int)self, (int)frame, what_sym[what], PyBytes_AS_STRING(ascii), PyFrame_GetLineNumber(frame)); - Py_DECREF(ascii); + w = what_sym[what]; } + ascii = PyUnicode_AsASCIIString(MyFrame_GetCode(frame)->co_filename); + printf("%x trace: f:%x %s @ %s %d\n", (int)self, (int)frame, what_sym[what], PyBytes_AS_STRING(ascii), PyFrame_GetLineNumber(frame)); + Py_DECREF(ascii); #endif #if TRACE_LOG |