[CastXML] Fwd: using castxml to generate control flow graph

Matt mattator at gmail.com
Sat Oct 1 11:16:15 EDT 2016


Hi,

You can filter the results with pygccxml.

2016-10-01 13:50 GMT+02:00 Ranadeep Biswas <ranadeep at cmi.ac.in>:
> Hello all,
>
> I am doing this project that needs to parse a c/c++ program and generate its
> control flow graph so that I can do some analysis on it. Can this be done
> using castxml?
>
> I tried to use castxml to generate xml output to build the CFG, but I can
> not generate the output as per my need. I could not find any good
> documentations. May be I am missing something.
>
> Consider this very simple c++ program.
>
> // foo.cpp
> int main(){
>   int x, y;
>   x = 0;
>   y = x + 3;
>   return 0;
> }
>
> now I run `castxml --castxml-cc-gnu g++ --castxml-gccxml foo.cpp`. It
> generates `foo.xml` file, but xml file contains a lot of other tags. But I
> don't find tags for variable x and y. Also is it possible to trim the
> output, so that I can get tags for only main, x, y and relevant types?
>
> Thanks,
>
> Ranadeep
> MSc CS 2nd year
> Chennai Mathematical Institute
>
>
> _______________________________________________
> CastXML mailing list
> CastXML at public.kitware.com
> http://public.kitware.com/mailman/listinfo/castxml
>


More information about the CastXML mailing list