From 597cf18b9d3f60cc680f919d1d8e62b29a1bdd9d Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Fri, 13 Jul 2018 11:57:15 +0100 Subject: [PATCH] Changing common/debug.h to crash_handler.h --- lib/examples/cell_search.c | 1 + .../common/{debug.h => crash_handler.h} | 11 ++++++++-- lib/include/srslte/srslte.h | 1 - lib/src/common/{debug.c => crash_handler.c} | 2 +- srsenb/src/main.cc | 2 +- srsepc/src/CMakeLists.txt | 22 +++++++++---------- srsepc/src/main.cc | 3 ++- srsue/src/main.cc | 2 +- 8 files changed, 26 insertions(+), 18 deletions(-) rename lib/include/srslte/common/{debug.h => crash_handler.h} (88%) rename lib/src/common/{debug.c => crash_handler.c} (98%) diff --git a/lib/examples/cell_search.c b/lib/examples/cell_search.c index 025be3c59..7e1a056c7 100644 --- a/lib/examples/cell_search.c +++ b/lib/examples/cell_search.c @@ -38,6 +38,7 @@ #include "srslte/srslte.h" #include "srslte/phy/rf/rf_utils.h" +#include "srslte/common/crash_handler.h" #ifndef DISABLE_RF diff --git a/lib/include/srslte/common/debug.h b/lib/include/srslte/common/crash_handler.h similarity index 88% rename from lib/include/srslte/common/debug.h rename to lib/include/srslte/common/crash_handler.h index 350d1336b..02db08ba2 100644 --- a/lib/include/srslte/common/debug.h +++ b/lib/include/srslte/common/crash_handler.h @@ -32,12 +32,19 @@ * Reference: *****************************************************************************/ -#ifndef SRSLTE_COMMON_DEBUG_H -#define SRSLTE_COMMON_DEBUG_H +#ifndef SRSLTE_CRASH_HANDLER_H +#define SRSLTE_CRASH_HANDLER_H #include #include "srslte/config.h" +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + void srslte_debug_handle_crash(int argc, char **argv); +#ifdef __cplusplus +} +#endif // __cplusplus #endif // SRSLTE_COMMON_DEBUG diff --git a/lib/include/srslte/srslte.h b/lib/include/srslte/srslte.h index 0304e34ca..c675e0fe7 100644 --- a/lib/include/srslte/srslte.h +++ b/lib/include/srslte/srslte.h @@ -49,7 +49,6 @@ #include "srslte/phy/common/sequence.h" #include "srslte/phy/common/phy_common.h" #include "srslte/phy/common/phy_logger.h" -#include "srslte/common/debug.h" #include "srslte/phy/ch_estimation/chest_ul.h" #include "srslte/phy/ch_estimation/chest_dl.h" diff --git a/lib/src/common/debug.c b/lib/src/common/crash_handler.c similarity index 98% rename from lib/src/common/debug.c rename to lib/src/common/crash_handler.c index e577c8740..658f70181 100644 --- a/lib/src/common/debug.c +++ b/lib/src/common/crash_handler.c @@ -31,7 +31,7 @@ #include #include "srslte/version.h" -#include "srslte/common/debug.h" +#include "srslte/common/crash_handler.h" const static char crash_file_name[] = "./srsLTE.backtrace.crash"; static int bt_argc; diff --git a/srsenb/src/main.cc b/srsenb/src/main.cc index 6926eb23f..9c15ef25c 100644 --- a/srsenb/src/main.cc +++ b/srsenb/src/main.cc @@ -31,7 +31,7 @@ #include #include "srslte/common/config_file.h" -#include "srslte/common/debug.h" +#include "srslte/common/crash_handler.h" #include #include diff --git a/srsepc/src/CMakeLists.txt b/srsepc/src/CMakeLists.txt index 9fb56ce30..f411eace5 100644 --- a/srsepc/src/CMakeLists.txt +++ b/srsepc/src/CMakeLists.txt @@ -34,17 +34,17 @@ if (RPATH) endif (RPATH) -add_executable(srsepc main.cc ) -target_link_libraries(srsepc srsepc_mme - srsepc_hss - srsepc_sgw - srslte_upper - srslte_common - ${CMAKE_THREAD_LIBS_INIT} - ${Boost_LIBRARIES} - ${SEC_LIBRARIES} - ${LIBCONFIGPP_LIBRARIES} - ${SCTP_LIBRARIES}) +add_executable(srsepc main.cc) +target_link_libraries( srsepc srsepc_mme + srsepc_hss + srsepc_sgw + srslte_upper + srslte_common + ${CMAKE_THREAD_LIBS_INIT} + ${Boost_LIBRARIES} + ${SEC_LIBRARIES} + ${LIBCONFIGPP_LIBRARIES} + ${SCTP_LIBRARIES}) add_executable(srsmbms mbms-gw/main.cc ) target_link_libraries(srsmbms srsepc_mbms_gw diff --git a/srsepc/src/main.cc b/srsepc/src/main.cc index 2255d9e4c..95883cd44 100644 --- a/srsepc/src/main.cc +++ b/srsepc/src/main.cc @@ -27,6 +27,7 @@ #include #include #include +#include "srslte/common/crash_handler.h" #include "srslte/common/bcd_helpers.h" #include "srslte/common/config_file.h" #include "srsepc/hdr/mme/mme.h" @@ -39,7 +40,7 @@ namespace bpo = boost::program_options; bool running = true; -void +void sig_int_handler(int signo){ running = false; } diff --git a/srsue/src/main.cc b/srsue/src/main.cc index 4279c8286..d0dd59f3e 100644 --- a/srsue/src/main.cc +++ b/srsue/src/main.cc @@ -38,7 +38,7 @@ #include "srsue/hdr/ue.h" #include "srslte/common/config_file.h" -#include "srslte/common/debug.h" +#include "srslte/common/crash_handler.h" #include "srslte/srslte.h" #include "srsue/hdr/metrics_stdout.h" #include "srsue/hdr/metrics_csv.h"