Skip to main content

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

Hi Kenneth, yes, there are some issues with the binary parser at the
moment and others are seeing similar issues. There is a race condition as
the binary parser, that fills in the structure, runs on a different
thread. WE need to revisit this area for Oxygen and see how we can
restructure things to avoid this.

Doug.

On 2016-12-02, 3:21 PM, "cdt-dev-bounces@xxxxxxxxxxx on behalf of Kenneth
MacKenzie" <cdt-dev-bounces@xxxxxxxxxxx on behalf of kwxm@xxxxxxxxxxxx>
wrote:

>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.
>
>_______________________________________________
>cdt-dev mailing list
>cdt-dev@xxxxxxxxxxx
>To change your delivery options, retrieve your password, or unsubscribe
>from this list, visit
>https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top