How to tell gcc to instrument the code with calls to my own function each _line_ of code?

前端 未结 4 1974
你的背包
你的背包 2020-12-19 12:26

For example, there is the source:

void my_special_debugging_function(const char* function_name, const char* file_name, int line_number);

void func1() {
             


        
4条回答
  •  甜味超标
    2020-12-19 12:53

    See -finstrument-functions in the GCC documentation. You may want to use dladdr() in the debugging function, which may also require linking with -Wl,-export-dynamic.

提交回复
热议问题