Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Behaviour of ICProject.getBinaryContainer.getBinaries()

Hello,

I've had a minor problem trying to find binaries in a C++ project, and
I'm not sure if it's a bug or not.

I'm working in a plugin which uses some CDT features and I have an
ICproject proj which I've got from a selection in the C projects view.

It looks as if I should be able to call

  proj.getBinaryContainer().getBinaries()

to get an array containing all of the executable binary files in the
project, but I find that sometimes it returns an empty array; at the
same time, proj.isStructureKnown() returns false.  This might happen,
for example, after I've run a binary using the "Run" button in the
main toolbar.  After switching windows a few times, the method will
return the expected result.

I've managed to get round this (I think) by writing my own method to
traverse the project, but I'm still curious.  I suspect my problem is
due to some issue with synchronisation or caching which I don't
understand, and it might help to avoid problems in future if I knew
exactly what's going on. Is there some way to make sure that the ICProject object reflects the structure of the project accurately?



I had another small problem with unexpected behaviour of ICProject
objects.  If I have a project "proj" which is closed, then I can see
that it's an IProject but not an ICproject, which is quite reasonable.
If I then open the project in the C view, but don't expand it, then I can se that it's an ICProject, but proj.isOpen() consistently returns false. Once you've expanded the project in the C view, isOpen()
returns true until you close the project even if you unexpand it.  This
isn't quite what I would expect, so is it the intended behaviour?  The
corresponding method for IProject returns true once you've opened the
project even if it's never been expanded, and this enables you to work
round the slightly unexpected behaviour of ICProject.


Thanks,

Kenneth MacKenzie

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



Back to the top