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?
Please also mark the comments that contributed to the solution of the article
Content-ID: 3336727755
Url: https://rootdb.com/forum/control-flow-graph-from-ansi-c-code-3336727755.html
Printed on: April 4, 2025 at 20:04 o'clock
1 Comment
Hi @sandeepkamra, welcome to the rootdb.com 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)
Have a look at the available developer commandline options
https://gcc.gnu.org/onlinedocs/gcc/Developer-Options.html
‘lineno’
Enable showing line numbers for statements.
Regards
@colinardo (mod)