From 8a3c20b33171005b73221d8721a25c7cc3f12a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vivek=20Das=C2=A0Mohapatra?= <vivek@collabora.co.uk> Date: Tue, 16 May 2017 20:08:40 +0100 Subject: [PATCH] Add a debug category for very detailed ELF processing logs --- utils/debug.h | 1 + utils/utils.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/utils/debug.h b/utils/debug.h index 188a82a0d..5f26828cc 100644 --- a/utils/debug.h +++ b/utils/debug.h @@ -10,6 +10,7 @@ enum DEBUG_MPROTECT = 0x1 << 4, DEBUG_WRAPPERS = 0x1 << 5, DEBUG_RELOCS = 0x1 << 6, + DEBUG_ELF = 0x1 << 7, DEBUG_ALL = 0xffff, }; diff --git a/utils/utils.c b/utils/utils.c index 9a7e3a54d..089c34287 100644 --- a/utils/utils.c +++ b/utils/utils.c @@ -96,6 +96,7 @@ void set_debug_flags (const char *control) if( strstr( control, "mprotect" ) ) debug_flags |= DEBUG_MPROTECT; if( strstr( control, "wrappers" ) ) debug_flags |= DEBUG_WRAPPERS; if( strstr( control, "reloc" ) ) debug_flags |= DEBUG_RELOCS; + if( strstr( control, "elf" ) ) debug_flags |= DEBUG_ELF; if( strstr( control, "all" ) ) debug_flags |= DEBUG_ALL; fprintf(stderr, "capsule debug flags: \n" @@ -105,12 +106,14 @@ void set_debug_flags (const char *control) " capsule : %c # setting up the proxy capsule" "\n" " mprotect: %c # handling mprotect (for RELRO)" "\n" " wrappers: %c # function wrappers installed in the capsule" "\n" - " reloc : %c # patching capsule symbols into external DSOs" "\n", + " reloc : %c # patching capsule symbols into external DSOs" "\n" + " elf : %c # detailed ELF introspection logging" "\n", (debug_flags & DEBUG_PATH ) ? 'Y' : 'n' , (debug_flags & DEBUG_SEARCH ) ? 'Y' : 'n' , (debug_flags & DEBUG_LDCACHE ) ? 'Y' : 'n' , (debug_flags & DEBUG_CAPSULE ) ? 'Y' : 'n' , (debug_flags & DEBUG_MPROTECT) ? 'Y' : 'n' , (debug_flags & DEBUG_WRAPPERS) ? 'Y' : 'n' , - (debug_flags & DEBUG_RELOCS ) ? 'Y' : 'n' ); + (debug_flags & DEBUG_RELOCS ) ? 'Y' : 'n' , + (debug_flags & DEBUG_ELF ) ? 'Y' : 'n' ); } -- GitLab