Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » DSDP - Real-Time Software Components (RTSC) » Dumping modules/interfaces in a package
Dumping modules/interfaces in a package [message #683] Mon, 01 December 2008 19:02 Go to next message
Chris Ring is currently offline Chris RingFriend
Messages: 16
Registered: July 2009
Location: Santa Barbara, CA
Junior Member
I'd like a way to dump the modules in a package. I'd also like to dump
any interface those modules implement (if any). I didn't see this feature
in xdc.tools.path, so I'm asking whether there's another way to do this
before I file an enhancement request.

As a concrete use case, I'd like to find all the packages on the package
path that contain modules that implement the "ti.sdo.ce.ICodec" interface.

Thanks.

Chris
Re: Dumping modules/interfaces in a package [message #688 is a reply to message #683] Mon, 01 December 2008 20:23 Go to previous message
Dave Russo is currently offline Dave RussoFriend
Messages: 172
Registered: July 2009
Senior Member
Chris Ring wrote:
> I'd like a way to dump the modules in a package. I'd also like to dump
> any interface those modules implement (if any). I didn't see this
> feature in xdc.tools.path, so I'm asking whether there's another way to
> do this before I file an enhancement request.
>
> As a concrete use case, I'd like to find all the packages on the package
> path that contain modules that implement the "ti.sdo.ce.ICodec" interface.
>
> Thanks.
>
> Chris
>
You can get a list of all packages on the package path using the
xdc.tools.path tool (see
http://rtsc.eclipse.org/cdoc-tip/index.html#xdc/tools/path/p ackage.html):
function showAllPackages()
{
var path = xdc.useModule('xdc.tools.path.Main');
var res = path.exec(["-a", "-n"]);
for (var i = 0; i < res.length; i++) {
print(res[i]);
}
}

You can get the module that implement a specific interface by first
loading the package then examining the list of modules maintained in
xdc.om.$modules (see
http://rtsc.eclipse.org/docs-tip/XDCscript_-_xdc.om.%24modul es). The
following edample lists all targets (modules that implement the
xdc.bldITarget interface):

function showAllTargets()
{
var ITarget = xdc.module("xdc.bld.ITarget");

for each (var mod in xdc.om.$modules) {
if (mod instanceof ITarget.Module) {
print(mod.$name);
}
}
}
Something similar is used to list all targets in a release of XDCTools;
see
http://rtsc.eclipse.org/docs-tip/Existing_Targets#How_the_ta bles_were_created.
Previous Topic:"function called through a non-compatible type" when activating diags_ENTRY
Next Topic:xdc.runtime.knl
Goto Forum:
  


Current Time: Mon Dec 30 14:33:32 GMT 2024

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

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

Back to the top