@@ -305,7 +305,7 @@ CTracer_check_missing_return(CTracer *self, PyFrameObject *frame)
305
305
goto error ;
306
306
}
307
307
}
308
- SHOWLOG (self -> pdata_stack -> depth , frame -> f_lineno , frame -> f_code -> co_filename , "missedreturn" );
308
+ SHOWLOG (self -> pdata_stack -> depth , PyFrame_GetLineNumber ( frame ) , frame -> f_code -> co_filename , "missedreturn" );
309
309
self -> pdata_stack -> depth -- ;
310
310
self -> pcur_entry = & self -> pdata_stack -> stack [self -> pdata_stack -> depth ];
311
311
}
@@ -529,13 +529,13 @@ CTracer_handle_call(CTracer *self, PyFrameObject *frame)
529
529
self -> pcur_entry -> file_data = file_data ;
530
530
self -> pcur_entry -> file_tracer = file_tracer ;
531
531
532
- SHOWLOG (self -> pdata_stack -> depth , frame -> f_lineno , filename , "traced" );
532
+ SHOWLOG (self -> pdata_stack -> depth , PyFrame_GetLineNumber ( frame ) , filename , "traced" );
533
533
}
534
534
else {
535
535
Py_XDECREF (self -> pcur_entry -> file_data );
536
536
self -> pcur_entry -> file_data = NULL ;
537
537
self -> pcur_entry -> file_tracer = Py_None ;
538
- SHOWLOG (self -> pdata_stack -> depth , frame -> f_lineno , filename , "skipped" );
538
+ SHOWLOG (self -> pdata_stack -> depth , PyFrame_GetLineNumber ( frame ) , filename , "skipped" );
539
539
}
540
540
541
541
self -> pcur_entry -> disposition = disposition ;
@@ -552,7 +552,7 @@ CTracer_handle_call(CTracer *self, PyFrameObject *frame)
552
552
self -> pcur_entry -> last_line = - frame -> f_code -> co_firstlineno ;
553
553
}
554
554
else {
555
- self -> pcur_entry -> last_line = frame -> f_lineno ;
555
+ self -> pcur_entry -> last_line = PyFrame_GetLineNumber ( frame ) ;
556
556
}
557
557
558
558
ok :
@@ -633,7 +633,7 @@ CTracer_handle_line(CTracer *self, PyFrameObject *frame)
633
633
634
634
STATS ( self -> stats .lines ++ ; )
635
635
if (self -> pdata_stack -> depth >= 0 ) {
636
- SHOWLOG (self -> pdata_stack -> depth , frame -> f_lineno , frame -> f_code -> co_filename , "line" );
636
+ SHOWLOG (self -> pdata_stack -> depth , PyFrame_GetLineNumber ( frame ) , frame -> f_code -> co_filename , "line" );
637
637
if (self -> pcur_entry -> file_data ) {
638
638
int lineno_from = -1 ;
639
639
int lineno_to = -1 ;
@@ -655,7 +655,7 @@ CTracer_handle_line(CTracer *self, PyFrameObject *frame)
655
655
}
656
656
}
657
657
else {
658
- lineno_from = lineno_to = frame -> f_lineno ;
658
+ lineno_from = lineno_to = PyFrame_GetLineNumber ( frame ) ;
659
659
}
660
660
661
661
if (lineno_from != -1 ) {
@@ -744,7 +744,7 @@ CTracer_handle_return(CTracer *self, PyFrameObject *frame)
744
744
}
745
745
746
746
/* Pop the stack. */
747
- SHOWLOG (self -> pdata_stack -> depth , frame -> f_lineno , frame -> f_code -> co_filename , "return" );
747
+ SHOWLOG (self -> pdata_stack -> depth , PyFrame_GetLineNumber ( frame ) , frame -> f_code -> co_filename , "return" );
748
748
self -> pdata_stack -> depth -- ;
749
749
self -> pcur_entry = & self -> pdata_stack -> stack [self -> pdata_stack -> depth ];
750
750
}
@@ -807,14 +807,14 @@ CTracer_trace(CTracer *self, PyFrameObject *frame, int what, PyObject *arg_unuse
807
807
#if WHAT_LOG
808
808
if (what <= (int )(sizeof (what_sym )/sizeof (const char * ))) {
809
809
<
8000
div class="diff-text-inner"> ascii = MyText_AS_BYTES (frame -> f_code -> co_filename );
810
- printf ("trace: %s @ %s %d\n" , what_sym [what ], MyBytes_AS_STRING (ascii ), frame -> f_lineno );
810
+ printf ("trace: %s @ %s %d\n" , what_sym [what ], MyBytes_AS_STRING (ascii ), PyFrame_GetLineNumber ( frame ) );
811
811
Py_DECREF (ascii );
812
812
}
813
813
#endif
814
814
815
815
#if TRACE_LOG
816
816
ascii = MyText_AS_BYTES (frame -> f_code -> co_filename );
817
- if (strstr (MyBytes_AS_STRING (ascii ), start_file ) && frame -> f_lineno == start_line ) {
817
+ if (strstr (MyBytes_AS_STRING (ascii ), start_file ) && PyFrame_GetLineNumber ( frame ) == start_line ) {
818
818
logging = TRUE;
819
819
}
820
820
Py_DECREF (ascii );
@@ -931,7 +931,7 @@ CTracer_call(CTracer *self, PyObject *args, PyObject *kwds)
931
931
932
932
#if WHAT_LOG
933
933
ascii = MyText_AS_BYTES (frame -> f_code -> co_filename );
934
- printf ("pytrace: %s @ %s %d\n" , what_sym [what ], MyBytes_AS_STRING (ascii ), frame -> f_lineno );
934
+ printf ("pytrace: %s @ %s %d\n" , what_sym [what ], MyBytes_AS_STRING (ascii ), PyFrame_GetLineNumber ( frame ) );
935
935
Py_DECREF (ascii );
936
936
#endif
937
937
0 commit comments