This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Can I use -data-evaluate-expression to evaluate sin(4.1)?


Hi,

On Mon, 2006-12-18 at 21:55 -0800, Nikolay Molchanov wrote:
> But if I ask "gdb" to evaluate sin(3.14) I get "1"
> (which is not correct), and if I ask to evaluate
> sin(4.1) or sin(5.1) I get "3" (?!).

I guess your system libraries aren't built with debuginfo.  This means
that GDB won't know the sin function's prototype and it will interpret
the result as an int.  There might also be other issues with passing
doubles to un-prototyped functions, but the previous point is sufficient
to explain your issue.

Fred


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]