The following program:
#include <stdio.h>
#include <math.h>
int main() {
printf("asin(1.0) = %f\n", asin(1.0));
return 0;
}
prints correctly 1.570796, but "p asin(1.0)" from within gdb prints 0. However,
this work fine:
(gdb) p ((double (*)(double))asin) (1.0)
$4 = 1.5707963267948966
Or, with libc debug symbols installed:
(gdb) p __asin (1.0)
$5 = 1.5707963267948966
The explanation from Daniel Jacobowitz is:
The C library does not contain debug info for a function named 'asin',
because the implementation is __asin, so GDB does not know it returns
a double. Also, GCC does not emit debug info for the called function
- I don't know why it doesn't, but probably to save space.
--
Summary: GCC does not emit debug info for a called function
Product: gcc
Version: 4.3.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: debug
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: arthur dot loiret at gmail dot com
GCC build triplet: i486-linux-gnu
GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39814