Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Real-Time Software Components (RTSC) » Assert strings populated in xdc.runtime.Text dispite being disabled
Assert strings populated in xdc.runtime.Text dispite being disabled [message #1367687] Mon, 19 May 2014 22:22 Go to next message
James Lockwood is currently offline James LockwoodFriend
Messages: 43
Registered: July 2009
Member
It seems that the assert strings should not be added to the charTab in xdc.runtime.Text when they are disabled. However, the Assert.xs module$static$init cycles through all modules looking for $$assertDescCfgs in each module used and assigns the id returned by Text.defineRopeCord(desc.msg) without regard to whether or not asserts are enabled or not. This populates Text.charTab with the messages of the asserts which will never get used when asserts are disabled, and unnecessarily bloats the firmware image size.
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 Go to previous messageGo to next message
Sasha Slijepcevic is currently offline Sasha SlijepcevicFriend
Messages: 114
Registered: July 2009
Senior Member
James,
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?
Re: Assert strings populated in xdc.runtime.Text dispite being disabled [message #1372622 is a reply to message #1372481] Wed, 21 May 2014 22:40 Go to previous messageGo to next message
James Lockwood is currently offline James LockwoodFriend
Messages: 43
Registered: July 2009
Member
Device is F28069, but we also use a F2808 which only has 4 Flash blocks. I am writing a bootloader that allows the application firmware (in the non-used blocks) to be upgraded via Modbus RTU writeFile commands. It is desirable to keep the bootloader in one Flash block, so space is a real concern.

I'm not too familiar with the Text module, and just started using Asserts throughout my code, and noticed the extra code size and went investigating.

I haven't tried Text.isLoaded = false. If this removes the strings, I'm fine with that, as the bootloader doesn't need the assert messages when finished.

What do you mean by setting Text.isLoaded to 'false' too bulky?
Re: Assert strings populated in xdc.runtime.Text dispite being disabled [message #1372681 is a reply to message #1372622] Wed, 21 May 2014 23:20 Go to previous messageGo to next message
Sasha Slijepcevic is currently offline Sasha SlijepcevicFriend
Messages: 114
Registered: July 2009
Senior Member
If you set Text.isLoaded to 'false', not only the Assert string but also the strings for Error and Log messages are removed. There is no fine-grained control that would allow you to remove Assert strings but leave Errors and Logs, for example.
Re: Assert strings populated in xdc.runtime.Text dispite being disabled [message #1374349 is a reply to message #1372681] Thu, 22 May 2014 15:47 Go to previous message
James Lockwood is currently offline James LockwoodFriend
Messages: 43
Registered: July 2009
Member
Text.isloaded = false is certainly an acceptable solution for me, and even better to get rid of everything. Thanks.
Previous Topic:XGCONF and .xml files documentation
Next Topic:Trouble building for the GCArmv7A target
Goto Forum:
  


Current Time: Wed Jun 20 08:08:36 GMT 2018

Powered by FUDForum. Page generated in 0.02348 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top