We all know that built-in functions can make debugging more difficult as they can be removed from stacks, etc. But suppose I want to call a built-in function from gdb, and I know its name and its arguments. I think I can do it, but I get the following:
Cannot evaluate function -- may be inlined
I used nmto list the characters in the library I used, and found that the functions I want to call were not there. No big surprise. I would like you to be able to create visible definitions of these built-in functions. I have access to header files that contain inline definitions currently, but I cannot change these headers. Perhaps there is some way to tell the compiler to emit definitions of all the built-in functions that it sees in the translation block? Or some other trick that might make it easier to call and verify the results of inline functions in gdb?
I am using GCC 4.7.2 and GDB 7.5.1 for Linux. And I can’t switch to a non-optimized build, because I am debugging the main dumps from production (in development, I would just turn off the optimization, then everything will be easier).
source
share