To use the math function, you have to compile the source code with -lm
option (this will remove the undefined reference error for math functions),
and for making debugging symbols available in gdb, you have to compile source code with -g
option.
gcc -g -o myprog main.c -lm
To debug the program run this with
gdb ./myprog
To print or use any function during debugging with gdb, use call
function of gdb
call (double)pow(3.0, 2.0)
Make sure to use the correct syntax of function, otherwise gdb return wrong answers
call (double) pow (double , double)