Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Real-Time Software Components (RTSC) » unloading a package and reloading it
unloading a package and reloading it [message #1726612] Tue, 15 March 2016 05:56 Go to next message
James Lockwood is currently offline James LockwoodFriend
Messages: 43
Registered: July 2009
Member
I would like to be able to unload a package and reload it during configuration time.

I am going to skip unimportant steps but here is the jist of why.

My typical scenario for making a legacy library function as if it were an XdcTools configurable module is to define metaonly config parameters which correspond to the #defined parameters in the legacy .h configuration file. I configure the module and call a function which uses a template to create the legacy config.h file, and if it results in a different file being created (different configuration), I then recompile the package so that the package will be up to date before the link process begins. After re-compiling, I create Xdc instances of this module.

This works fine unless the legacy module declares structs which omit/add fields (with #if <some_config_enabled> / #endif pair), and this struct definition needs to be in my Instance_State. To solve this problem, I have created an interface, of which my module inherits. In the interface, I have the structs which contain possible variations in their definitions based on the configuration. The interface .xdc file itself is also generated from a template (which if it changes is part of the condition of triggering an automatic recompile) and now these have the parallel structures the same as the legacy module will.

Unfortunately, since the struct definitions are not known until configuration time, and my module has already been loaded, when it comes to processing my instance$static$init, the previous definitions are already loaded, and I can not find any way to make the xdc environment re-load the new definition.

In poking around, I found that xdc.services.intern.xsr.java has the PkgLoader Class. But I can not use this, as it calls the findPkgClass method which in turn references a HashMap and if the entry for the package exists, it uses the already existing defined class. I would really like the PkLoader Class to be augmented such that the hashmap entry can be deleted, so that the exec function can be called again, and it would then load my newly defined module.

I would like to kindly request this 'feature'. Does this make sense, or would there be side-effects that I am unaware of?

Thanks,
James

Re: unloading a package and reloading it [message #1726691 is a reply to message #1726612] Tue, 15 March 2016 19:29 Go to previous message
James Lockwood is currently offline James LockwoodFriend
Messages: 43
Registered: July 2009
Member
I think I have a work-around that doesn't require unloading and reloading (and is probably better), so please ignore the request unless I post again.

Thanks.
Previous Topic:EMF/UML progress
Next Topic:Standalone Eclipse with ROV and GDB
Goto Forum:
  


Current Time: Tue Sep 25 08:59:18 GMT 2018

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

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

Back to the top