From 53d40413752d791483a3c1b6daca82f1e07feb81 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Mon, 31 Jul 2017 11:29:03 +0200 Subject: [PATCH] debugging: add calls to 'personality' MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Insertion of calls to personality for the only pupose to be able to set breakpoint at some strategic places. The chosen places are: - After the debug wait point. The intend is to allow simulation of breakpoint after attaching to the waiting process. - Before starting the bindings but after loading it. The intend is to allow loading of symbols and setting of breakpoints in the debugged binding without attaching to afb-daemon that comes without debug symbols. Change-Id: Ie3bfce0956c9844586c7a5f8bd820acb7f58772c Signed-off-by: José Bollo --- src/afb-debug.c | 6 ++++++ src/main.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/src/afb-debug.c b/src/afb-debug.c index e7a5c643..db403a6b 100644 --- a/src/afb-debug.c +++ b/src/afb-debug.c @@ -30,6 +30,9 @@ #include #include #include +#if !defined(NO_CALL_PERSONALITY) +#include +#endif #include "verbose.h" @@ -98,6 +101,9 @@ void afb_debug(const char *key) indicate(NULL); sigprocmask(SIG_SETMASK, &oss, NULL); NOTICE("DEBUG WAIT after %s", key); +#if !defined(NO_CALL_PERSONALITY) + personality((unsigned long)-1L); +#endif } if (has_key(key, secure_getenv(key_env_break))) { NOTICE("DEBUG BREAK before %s", key); diff --git a/src/main.c b/src/main.c index a989a702..77392f83 100644 --- a/src/main.c +++ b/src/main.c @@ -29,6 +29,10 @@ #include #include +#if !defined(NO_CALL_PERSONALITY) +#include +#endif + #include #include @@ -598,6 +602,9 @@ static void start(int signum) /* start the services */ afb_debug("start-start"); +#if !defined(NO_CALL_PERSONALITY) + personality((unsigned long)-1L); +#endif if (afb_apiset_start_all_services(main_apiset, 1) < 0) goto error; -- 2.16.6