seL4 / seL4_libs

No-assurance libraries for rapid-prototyping of seL4 apps.
https://docs.sel4.systems
Other
52 stars 62 forks source link

use CONFIG_DEBUG_BUILD guards #30

Closed axel-h closed 3 years ago

axel-h commented 3 years ago

debug features will not work if CONFIG_DEBUG_BUILD is not set.

axel-h commented 3 years ago

Wit the changes from @nomadeel that were also merged, the merge of everything in this PR does not really make sense any longer. We don't have inline int debug_cap_is_valid()now when CONFIG_DEBUG_BUILD is not set. So there is not point in checking within inline int debug_cap_is_valid() if CONFIG_DEBUG_BUILD is set and behave differently:

#ifdef CONFIG_DEBUG_BUILD
static inline int debug_cap_is_valid(seL4_CPtr cap)
{
#ifdef CONFIG_DEBUG_BUILD
    return (0 != seL4_DebugCapIdentify(cap));
#else
    return 0; /* fail check on non-debug kernels */
#endif
}
...
#endif /* CONFIG_DEBUG_BUILD*/

So we want to keep debug_cap_is_valid() available unconditionally and have it return a failure of do we want to remove it from the code in this case completely?