3310487509
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-ID: 3336727755

Url: https://administrator.de/en/control-flow-graph-from-ansi-c-code-3336727755.html

Ausgedruckt am: 21.12.2024 um 15:12 Uhr

colinardo
Lösung colinardo 14.07.2022 aktualisiert um 12:09:22 Uhr
Goto Top
Hi @3310487509, welcome to the administrator.pro community!
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. 
Hope this helps.

Regards
@colinardo (mod)