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] interfacing non-OCaml programs with Frama-C

  • Subject: [Frama-c-discuss] interfacing non-OCaml programs with Frama-C
  • From: Pascal.Cuoq at (Pascal Cuoq)
  • Date: Mon, 2 Feb 2009 18:28:47 +0100
  • In-reply-to: <>
  • References: <> <> <> <> <> <> <> <> <>

On Feb 2, 2009, at 3:04 PM, jsd slml wrote:
> I have a question about this Locations.Zone.t option
> for example, with this code:
> int a, b;
> void dummy(int,int);
> void main(int c){
>     c = c ? 0 : 1;
>     if (c)
>         b = 2;
>     a = c;
>     dummy(a,b);
> }
> While visiting this code, at the instruction that call dummy, can  
> this tell me that lval 'a' depends on 'c' ? can it tell for lval 'b' ?


The dependencies optionally computed by passing an argument of
the kind "Some zone" are only one of the building blocks necessary
for the dependencies that you are asking for. The dependency of
an lvalue such as "c" is nothing. The dependency of an l-value such
as "t[a+b]" is made of "a" and "b" (assuming t is an array).

The dependencies that you want seem to correspond exactly to
those computed by option -deps or -calldeps, which are computed
at every statement of the function even though they are only displayed
for the last one. Both options are implemented
in the same plug-in src/from.
I already recommended you take look at these options in
I invite you to read this message again with the experience
you have accumulated since. Do not hesitate to look at the
implementation of this plug-in if these options are exactly
what you want, except that you need the dependencies in at
another statement than the last one.

If these dependencies do not do what you want for some reason,
it would be better to give an explanation of how they do not
accomplish what you want, rather than asking for a (lengthy)
discussion on how you can write a plug-in that computes
identical dependencies.

> If that's the case, I'm not sure what I need to pass as the 'deps'  
> argument, and how to process the first component of the returned  
> couple.
> In the end, I would like to have a list of lval (or exp) on which  
> the lval given to eval_lval depends, so I can also evaluate them.

You can activate the computation of path dependencies
by passing "(Some Locations.Zone.bottom)".
You obtain a zone, which is an abstract representation for
a set of bits in memory. Zones can not in general be
transformed into l-values (in the presence of unions or casts
in the program, the l-value may not exist at all).