|Re: Assert strings populated in xdc.runtime.Text dispite being disabled [message #1372481 is a reply to message #1367687]
||Wed, 21 May 2014 21:15
| Sasha Slijepcevic
Registered: July 2009
you are right that it does not make sense to keep Assert strings for unused asserts in the charTab. However, when we go through asserts in module$static$init, we don't really know who is using them. Your C code can freely use any Assert declared in xdc.runtime, and the code in module$static$init can't detect that. Diags masks are used to disable/enable asserts in the code for the module for that mask, not to disable/enable asserts declared in that module.
If you are thinking of the use case where all Asserts in all modules are disabled, that would be easier to figure out bu going through all modules' Diags masks and exit if all of them set ASSERT and INTERNAL bits to ALWAYS_OFF.
However, there is an undocumented feature that allows you to bypass any mask checks anyway and use all alerts independent of the Diags mask configuration. Look into Assert__epilogue.h and just define xdc_runtime_Assert_DISABLE_CONDITIONAL_ASSERT when compiling and you'll be able to see all alerts in the code compiled that way no matter how you configure the Diags mask for your module or for xdc_runtime_Main if asserts are in the app code.
The reason we did not document that feature is just an oversight. It's being used and I don't think we can take it out. But, what we could is to detect that same use case where all Asserts are permanently disabled, and Assert_raise wouldn't even try to read Assert strings from charTab.
Is the option of setting Text.isLoaded to 'false' too bulky? What's the device you are using? Is Text.isLoaded even working on it?
Powered by FUDForum
. Page generated in 0.02809 seconds