Control Flow Graph from ANSI C code

sandeepkamra
Goto Top
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

Url: https://administrator.pro/contentid/3336727755

Printed on: August 7, 2022 at 14:08 o'clock

Member: colinardo
Solution colinardo Jul 14, 2022 updated at 10:09:22 (UTC)
Goto Top
Hi @SandeepKamra, welcome to the administrator.pro community!
Have a look at the available developer commandline options
https://gcc.gnu.org/onlinedocs/gcc/Developer-Options.html
Hope this helps.

Regards
@colinardo (mod)