File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -218,9 +218,9 @@ ENDIF()
218218OPTION (ENABLE_GCOV "Enable gcov (debug, Linux builds only)" OFF )
219219IF (ENABLE_GCOV AND NOT WIN32 AND NOT APPLE )
220220 SET (CMAKE_CXX_FLAGS_DEBUG
221- "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage" )
221+ "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage -DHAVE_GCOV " )
222222 SET (CMAKE_C_FLAGS_DEBUG
223- "${CMAKE_C_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage" )
223+ "${CMAKE_C_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage -DHAVE_GCOV " )
224224 SET (CMAKE_EXE_LINKER_FLAGS_DEBUG
225225 "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage -lgcov" )
226226ENDIF ()
Original file line number Diff line number Diff line change @@ -2223,12 +2223,23 @@ void _db_flush_()
22232223
22242224
22252225#ifndef __WIN__
2226+
2227+ #ifdef HAVE_GCOV
2228+ extern void __gcov_flush ();
2229+ #endif
2230+
22262231void _db_suicide_ ()
22272232{
22282233 int retval ;
22292234 sigset_t new_mask ;
22302235 sigfillset (& new_mask );
22312236
2237+ #ifdef HAVE_GCOV
2238+ fprintf (stderr , "Flushing gcov data\n" );
2239+ fflush (stderr );
2240+ __gcov_flush ();
2241+ #endif
2242+
22322243 fprintf (stderr , "SIGKILL myself\n" );
22332244 fflush (stderr );
22342245
You can’t perform that action at this time.
0 commit comments