Skip to content

Commit 9097c0d

Browse files
committed
debug: incidental debug improvements in tracer.c
1 parent 45ba7e7 commit 9097c0d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

coverage/ctracer/tracer.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ CTracer_dealloc(CTracer *self)
119119
}
120120

121121
#if TRACE_LOG
122+
/* Set debugging constants: a file substring and line number to start logging. */
123+
static const char * start_file = "badasync.py";
124+
static int start_line = 1;
125+
122126
static const char *
123127
indent(int n)
124128
{
@@ -132,9 +136,6 @@ indent(int n)
132136
}
133137

134138
static BOOL logging = FALSE;
135-
/* Set these constants to be a file substring and line number to start logging. */
136-
static const char * start_file = "nested.py";
137-
static int start_line = 1;
138139

139140
static void
140141
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
787788
#endif
788789

789790
#if WHAT_LOG
791+
const char * w = "XXX ";
790792
if (what <= (int)(sizeof(what_sym)/sizeof(const char *))) {
791-
ascii = PyUnicode_AsASCIIString(MyFrame_GetCode(frame)->co_filename);
792-
printf("%x trace: f:%x %s @ %s %d\n", (int)self, (int)frame, what_sym[what], PyBytes_AS_STRING(ascii), PyFrame_GetLineNumber(frame));
793-
Py_DECREF(ascii);
793+
w = what_sym[what];
794794
}
795+
ascii = PyUnicode_AsASCIIString(MyFrame_GetCode(frame)->co_filename);
796+
printf("%x trace: f:%x %s @ %s %d\n", (int)self, (int)frame, what_sym[what], PyBytes_AS_STRING(ascii), PyFrame_GetLineNumber(frame));
797+
Py_DECREF(ascii);
795798
#endif
796799

797800
#if TRACE_LOG

0 commit comments

Comments
 (0)