From d1aea1408ade7849e16efd662a5c6e1bb2415c9c Mon Sep 17 00:00:00 2001 From: Maieul BOYER Date: Wed, 11 Sep 2024 18:11:48 +0200 Subject: [PATCH] update: trying to debug funcheck hanging --- Makefile | 8 ++++---- sources/signal_handler.c | 9 ++++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 0a7e9c3e..17856c90 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # By: rparodi +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2023/11/12 11:05:05 by rparodi #+# #+# # -# Updated: 2024/09/02 16:17:16 by maiboyer ### ########.fr # +# Updated: 2024/09/11 17:55:12 by maiboyer ### ########.fr # # # # **************************************************************************** # @@ -47,10 +47,10 @@ endif # CFLAGS_ADDITIONAL += -DNVALGRIND # TODO: REMOVE THIS WHEN FINISHING THIS: -CFLAGS_ADDITIONAL += -O0 -CFLAGS_ADDITIONAL += -Wno-cpp -Wno-type-limits -Wno-unused-command-line-argument +# CFLAGS_ADDITIONAL += -O0 +# CFLAGS_ADDITIONAL += -Wno-cpp -Wno-type-limits -Wno-unused-command-line-argument CFLAGS_ADDITIONAL += -gcolumn-info -g3 -CFLAGS_ADDITIONAL += '-DERROR=((void)printf("ERROR HERE: " __FILE__ ":%d in %s\n", __LINE__, __func__), 1)' +# CFLAGS_ADDITIONAL += '-DERROR=((void)printf("ERROR HERE: " __FILE__ ":%d in %s\n", __LINE__, __func__), 1)' # CFLAGS_ADDITIONAL += -O2 # CFLAGS_ADDITIONAL += -fuse-ld=gold -Wl,--print-symbol-counts -Wl,/tmp/symbols_count.log # CFLAGS_ADDITIONAL += -fuse-ld=lld -ffunction-sections -fdata-sections -Wl,--gc-sections -Wl,-O3 -Wl,--allow-multiple diff --git a/sources/signal_handler.c b/sources/signal_handler.c index 3ea8550c..27e515ed 100644 --- a/sources/signal_handler.c +++ b/sources/signal_handler.c @@ -6,7 +6,7 @@ /* By: maiboyer +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/05/02 13:22:14 by maiboyer #+# #+# */ -/* Updated: 2024/08/03 16:34:19 by maiboyer ### ########.fr */ +/* Updated: 2024/09/11 17:59:17 by maiboyer ### ########.fr */ /* */ /* ************************************************************************** */ @@ -17,6 +17,12 @@ #include #include +static void sig_print_trace(int _idk) +{ + (void)(_idk); + print_trace(); +} + t_error install_signal(void) { struct sigaction data; @@ -27,5 +33,6 @@ t_error install_signal(void) return (ERROR); if (sigaction(SIGQUIT, &data, NULL)) return (ERROR); + signal(SIGUSR1, sig_print_trace); return (NO_ERROR); }