Skip to content
Snippets Groups Projects
Commit 8a3c20b3 authored by Vivek Das Mohapatra's avatar Vivek Das Mohapatra
Browse files

Add a debug category for very detailed ELF processing logs

parent c191e68a
No related branches found
No related tags found
1 merge request!311Build capsule-capture-libs from a bundled copy of libcapsule
......@@ -10,6 +10,7 @@ enum
DEBUG_MPROTECT = 0x1 << 4,
DEBUG_WRAPPERS = 0x1 << 5,
DEBUG_RELOCS = 0x1 << 6,
DEBUG_ELF = 0x1 << 7,
DEBUG_ALL = 0xffff,
};
......
......@@ -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' );
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment