How to evaluate functions in GDB?
问题 I wonder why evaluate function doesn't work in gdb? In my source file I include, when debugging in gdb, these examples are wrong evaluations. (gdb) p pow(3,2) $10 = 1 (gdb) p pow(3,3) $11 = 1 (gdb) p sqrt(9) $12 = 0 回答1: My guess is that the compiler and linker does some magic with those particular functions. Most likely to increase performance. If you absolutely need pow() to be available in gdb then you can create your own wrapper function: double mypow(double a, double b) { return pow(a,b)