Frama-C-discuss mailing list archives

This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] Scope plugin from command line



Hi,

Basically what I'm trying to do is obtain data dependencies for each PP 
in the program in an automated manner and use this info for something 
else that works directly on the source code. This is why I needed the 
[Elem]-to-line number mapping.

I implemented the patch that Pascal gave and it seems to have solved my 
problems. I just wrote an external program to extract the information I 
need from the -pdg output. Should there be any other problem I'll get 
back to you.

Thanks for the help!

-----
Vijayaraghavan Murali
http://www.comp.nus.edu.sg/~mvijayar


On 06/06/2011 15:29, Anne Pacalet wrote:
> Hello,
>
> Le 05/06/2011 04:24, Vijayaraghavan Murali a ?crit :
>> The output from -pdg is almost exactly what I wanted, except since there is no
>> line number information printed, there is no way to find out which line the
>> [Elem]s correspond to. One can look at the actual code that is printed next to
>> [Elem], but the exact same code (syntax-wise) could appear at different places
>> in the program.
>
> The PDG output is mainly use for debug purpose and then I am not surprised
> that it is difficult to extract information from it...
>
>> Is there a way to print line number information or is there any mapping from the
>> [Elem]s to program points? This would solve all my problems.
>
> At the moment, there is no way to do that with the existing options,
> but maybe you should consider writing a small plug-in to extract exactly
> the information that you need. As Pascal said, the provided information
> could then be much richer. For instance, for the "Dependencies ->  Show defs"
> information, you should have a look at the function [Scope.get_defs]
> in [src/kernel/db.mli]. Because it gives you the internal representation
> you'll be able to get information such as line number, and so on.
>
> If you chose to do so and need some help, please ask.
> Maybe it can be useful to have a little more information about what you
> are trying to do in order to give you a more appropriate answer ?
>
> Hope this helps,