# HG changeset patch # User Alexis Jeandet # Date 2018-10-10 18:09:53 # Node ID 9d5e16586c2c299611cdf2e5115f7e5215f0ed3b # Parent ff4ee5ce9f100890cc313eb85c47dcaf44892dde Few cosmetic changes and lowered optim to -O2 - Raised CMake minimum version to 3.6 everywhere - Add option to either explictly call gcov_exit or register it on exit - Raised FSW patch level to 22 diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.6) +cmake_minimum_required (VERSION 3.6) project (LFR_FSW) if(NOT CMAKE_BUILD_TYPE) diff --git a/libgcov/CMakeLists.txt b/libgcov/CMakeLists.txt --- a/libgcov/CMakeLists.txt +++ b/libgcov/CMakeLists.txt @@ -9,7 +9,10 @@ set(LIB_GCOV_SOURCES gcov-iov.h libgcov.c ) - +if(Coverage) +# add_definitions(-DGCOV_USE_EXIT) + add_definitions(-DGCOV_ENABLED) +endif() add_library(gcov STATIC ${LIB_GCOV_SOURCES}) add_custom_target(gcovr diff --git a/libgcov/gcov-io.c b/libgcov/gcov-io.c --- a/libgcov/gcov-io.c +++ b/libgcov/gcov-io.c @@ -475,8 +475,10 @@ gcov_read_counter (void) gcov_crc32 = crc32; +#ifdef GCOV_USE_EXIT if (!gcov_list) atexit (gcov_exit); +#endif info->next = gcov_list; gcov_list = info; diff --git a/sparc/sparc-rtems.cmake b/sparc/sparc-rtems.cmake --- a/sparc/sparc-rtems.cmake +++ b/sparc/sparc-rtems.cmake @@ -10,8 +10,8 @@ option(fix-b2bst "Activate -mfix-b2bst s option(Coverage "Enables code coverage" OFF) -set(CMAKE_C_FLAGS_RELEASE "-O3") -set(CMAKE_C_FLAGS_DEBUG "-O3 -fno-inline") +set(CMAKE_C_FLAGS_RELEASE "-O2") +set(CMAKE_C_FLAGS_DEBUG "-O2 -g -fno-inline") if(fix-b2bst) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.6) +cmake_minimum_required (VERSION 3.6) project (fsw) include(sparc-rtems) @@ -65,7 +65,7 @@ option(FSW_Instrument_Scrubbing "Enable set(SW_VERSION_N1 "3" CACHE STRING "Choose N1 FSW Version." FORCE) set(SW_VERSION_N2 "2" CACHE STRING "Choose N2 FSW Version." FORCE) set(SW_VERSION_N3 "0" CACHE STRING "Choose N3 FSW Version." FORCE) -set(SW_VERSION_N4 "21" CACHE STRING "Choose N4 FSW Version." FORCE) +set(SW_VERSION_N4 "22" CACHE STRING "Choose N4 FSW Version." FORCE) if(FSW_verbose) add_definitions(-DPRINT_MESSAGES_ON_CONSOLE) @@ -126,5 +126,5 @@ if(NOT FSW_lpp_dpu_destid) endif() -add_test_cppcheck(fsw STYLE UNUSED_FUNCTIONS POSSIBLE_ERROR MISSING_INCLUDE) +#add_test_cppcheck(fsw STYLE UNUSED_FUNCTIONS POSSIBLE_ERROR MISSING_INCLUDE) diff --git a/src/tc_handler.c b/src/tc_handler.c --- a/src/tc_handler.c +++ b/src/tc_handler.c @@ -179,6 +179,12 @@ int action_reset(ccsdsTelecommandPacket_ */ PRINTF("this is the end!!!\n"); +#ifdef GCOV_ENABLED +#ifndef GCOV_USE_EXIT + extern void gcov_exit (void); + gcov_exit(); +#endif +#endif exit(0); send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time );