[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Static Analysis Framework for CDT

Sorry to not respond sooner but I was out most of last week...

Yes PTP does some static analysis with CDT.
The MPI barrier analysis was done by our group at the time, including a summer student, a couple of years ago.
The structures that she built were somewhat isolated into one general eclipse plug-in package of the structures,
and then another one with the specifics for the barrier analysis. Those are both part of PTP/PLDT now.
We never contributed it back to CDT, simple for lack of time/resource to do this, but it is isolated, because I was hoping that would happen, but it didn't.
These would be a great basis for a CDT static analysis framework, IMHO.

My EclipseCon talk last year "Static Analysis in PTP with CDT" gives code examples of how to use these.
See http://www.eclipsecon.org/2008/?page=sub/&id=373 - starting at slide 24 is the specific stuff we did.
We construct a Call graph, and control flow graph, and a partial dependency graph (a defined/use chain, which isn't a "full" dependency graph).
We used these to do static analysis of MPI C code to detect potential deadlocks, finding concurrently executed statements to do this.
Note that the CDT Call hierarchy also makes a call graph - this and our work were being done at approximately the same time, or else we would have gladly piggybacked on Markus' work.
Slide 27 shows where the code is in the PTP repository for the call graphs and some utility functions for using them.
Note that there is a project (org.eclipse.ptp.pldt.mpi.analysis.cdt) that isolates the generic analysis code, then a separate project that does the mpi-specific stuff with that.
The generic control flow graph and dependency graph code etc. is all in that same project, i believe.

There's also some separate analysis code in our OpenMP analysis plugins, that was done by a now-retired colleague, separately.
It does some analysis to find potential concurrently executing code. It also builds some analysis structures to do this.. I'd have to dig up what they are.

I've updated the analysis plugins so they all build with CDT 6.0 but there are some small execution bugs with the OpenMP analysis that i have yet to tackle.
I was hoping to clean up, exercise, and document the OpenMP analysis plugins for EclipseCon, but unforeseen job changes and travel restrictions made that not possible.



...Beth

Beth Tibbitts (859) 243-4981 (TL 545-4981)
Eclipse Parallel Tools Platform http://eclipse.org/ptp
Mailing Address: IBM Corp., Coldstream Research Campus, 745 West New Circle Road, Lexington, KY 40511

Inactive hide details for Elena Laskavaia ---04/17/2009 12:25:29 PM---Parts of it implemented in ptp. It is not good as gcc butElena Laskavaia ---04/17/2009 12:25:29 PM---Parts of it implemented in ptp. It is not good as gcc but it different technology anyway.

          Elena Laskavaia <elaskavaia@xxxxxxx>
          Sent by: cdt-dev-bounces@xxxxxxxxxxx

          04/17/2009 12:24 PM

          Please respond to
          "CDT General developers list." <cdt-dev@xxxxxxxxxxx>

To

"CDT General developers list." <cdt-dev@xxxxxxxxxxx>

cc


Subject

Re: [cdt-dev] Static Analysis Framework for CDT

Parts of it implemented in ptp. It is not good as gcc but it different technology anyway.

Dominique Toupin wrote:
> Markus, are you planning on providing advanced static analysis e.g.
> data-flow analysis :-)
>
>> -----Original Message-----
>> From: cdt-dev-bounces@xxxxxxxxxxx
>> [
mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Doug Schaefer
>> Sent: 17-Apr-09 11:53
>> To: CDT General developers list.
>> Subject: RE: [cdt-dev] Static Analysis Framework for CDT
>>
>> Then I suggest that you need to take a closer look at the CDT
>> core ;) Markus's EclipseCon presentation would be a great
>> place to start.
>>
>> Doug.
>>
>> On Fri, 2009-04-17 at 11:21 -0400, Dominique Toupin wrote:
>>> In practice I don't think CDT parser has the same
>> info/capability as
>>> GCC, GCC has a lot of info about the code and we can do
>> advance static
>>> analysis (not grep like) with this info.
>>> I am not suggesting to integrate GCC code into CDT, the GCC static
>>> analysis would be an external tool just like GCC/GDB today.
>>> Even if it's an external tool it brings a lot of features
>> to CDT, it's
>>> just like compile (GCC) and debug (GDB) today.
>>>
>>>> -----Original Message-----
>>>> From: cdt-dev-bounces@xxxxxxxxxxx
>>>> [
mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Doug Schaefer
>>>> Sent: 17-Apr-09 09:52
>>>> To: CDT General developers list.
>>>> Subject: Re: [cdt-dev] Static Analysis Framework for CDT
>>>>
>>>> My bigger concern is that all GCC plug-ins must be GPL. I'd
>>>> especially be worried about plug-ins written specifically for the
>>>> CDT and whether that affects the definition of "derived"
>>>> and thus, causing us legal grief.
>>>>
>>>> At any rate, theoretically, the CDT parsers already
>> create the same
>>>> information that gcc would. And we can avoid any legal
>> problems that
>>>> way.
>>>>
>>>> Doug.
>>>>
>>>> On Fri, 2009-04-17 at 09:43 -0400, Elena Laskavaia wrote:
>>>>> GCC plugins means it would be part of GCC which is external
>>>> to eclipse?
>>>>> If so it can be just run as external and not part of the
>>>> framework which is Java based.
>>>>> Dominique Toupin wrote:
>>>>>> Hi Elena,
>>>>>>
>>>>>> If you are doing simple rules, CDT alone should be OK
>> but if you
>>>>>> need complicated rules (e.g. data-flow analysis) then you
>>>> might want
>>>>>> to also look at GCC plugin
>>>>
http://gcc.gnu.org/wiki/GCC_Plugins, they
>>>>>> did progress and hopefully the architecture will be
>>>> resolve for the
>>>>>> GCC summit (
http://gccsummit.org/2009/), some CDT committers
>>>>>> will also attend the GCC summit (at least Francois and Marc).
>>>>>>
>>>>>> Last year at the GCC summit some static analysis tools
>>>> based on GCC
>>>>>> where presented e.g.
>>
https://developer.mozilla.org/en/Treehydra,
>>
https://developer.mozilla.org/en/Dehydra?rdfrom=https%3A%2F%2Fwiki.m
>>>>>> ozil la.org%2Findex.php%3Ftitle%3DDehydra_GCC%26redirect%3Dno.
>>>>>>
>>>>>> If we can have good static analysis rules with GCC
>>>> plugins it will
>>>>>> make sense to integrate those into CDT.
>>>>>>
>>>>>> Dominique
>>>>>>
>>>>>>
>>>>>>> -----Original Message-----
>>>>>>> From: cdt-dev-bounces@xxxxxxxxxxx
>>>>>>> [
mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Elena
>>>>>>> Laskavaia
>>>>>>> Sent: 16-Apr-09 22:44
>>>>>>> To: CDT General developers list.
>>>>>>> Subject: [cdt-dev] Static Analysis Framework for CDT
>>>>>>>
>>>>>>> This is something I am doing in my spare time - I want to
>>>>>>> create static analysis framework for CDT, light weigh set of
>>>> classes that
>>>>>>> allow to have common interface for dealing with problems
>>>> produced
>>>>>>> by static analysis tools (and some default checkers,
>>>> such what JDT
>>>>>>> has, i.e Potential Null Pointer Dereference, etc).
>>>>>>>
>>>>>>> See design details at:
>>>>>>>
http://wiki.eclipse.org/CDT/designs/StaticAnalysis
>>>>>>> _______________________________________________
>>>>>>> cdt-dev mailing list
>>>>>>> cdt-dev@xxxxxxxxxxx
>>>>>>>
https://dev.eclipse.org/mailman/listinfo/cdt-dev
>>>>>>>
>>>>>> _______________________________________________
>>>>>> cdt-dev mailing list
>>>>>> cdt-dev@xxxxxxxxxxx
>>>>>>
https://dev.eclipse.org/mailman/listinfo/cdt-dev
>>>>> _______________________________________________
>>>>> cdt-dev mailing list
>>>>> cdt-dev@xxxxxxxxxxx
>>>>>
https://dev.eclipse.org/mailman/listinfo/cdt-dev
>>>> _______________________________________________
>>>> cdt-dev mailing list
>>>> cdt-dev@xxxxxxxxxxx
>>>>
https://dev.eclipse.org/mailman/listinfo/cdt-dev
>>>>
>>> _______________________________________________
>>> cdt-dev mailing list
>>> cdt-dev@xxxxxxxxxxx
>>>
https://dev.eclipse.org/mailman/listinfo/cdt-dev
>> _______________________________________________
>> cdt-dev mailing list
>> cdt-dev@xxxxxxxxxxx
>>
https://dev.eclipse.org/mailman/listinfo/cdt-dev
>>
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
>
https://dev.eclipse.org/mailman/listinfo/cdt-dev
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev

GIF image

GIF image

GIF image