how to make gcc spit out a mapping from flow graphs to source code line numbers

前端 未结 3 1985
迷失自我
迷失自我 2021-02-08 13:06

Can gcc spit out, given a C file, a list of the all function calls that occur, with filename and line number both for the call itself and for the function\'s declaration?

<
3条回答
  •  佛祖请我去吃肉
    2021-02-08 13:37

    Valgrind and KCacheGrind seems a good tool for this use :

    valgrind --tool=callgrind --dump-instr=yes ./your_binary
    

    This will give you a file called callgrind.out.pid that you can open with KCacheGrind. This will let you see lots of informations like call graph, filename ...

提交回复
热议问题