Goto Top

Control Flow Graph from ANSI C code

I'm building tool for testing ansi c applications. Basically, load code, view control flow graph, run test, mark all vertexes which were hit. I'm attempting to build CFG all by myself from parsing code. Sadly It gets screwed up assuming that code is nested. GCC gives ability to get CFG from compiled code. could compose a parser for its output, but I need line numbers for setting breakpoints. Is there way for getting line numbers when outputting Control Flow Graph with -fdump-tree-cfg or -fdump-tree-vcg?

Content-Key: 3336727755


Printed on: December 9, 2023 at 08:12 o'clock

Member: colinardo
Solution colinardo Jul 14, 2022 updated at 10:09:22 (UTC)
Goto Top
Hi @SandeepKamra, welcome to the community!
Have a look at the available developer commandline options

    Enable showing line numbers for statements. 
Hope this helps.

@colinardo (mod)