0

How do I print / check floating point values in gdb?

I tried doing fldpi and then in gdb print $st and it says it's void

Im on x86 NASM

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
user259137
  • 85
  • 1
  • 1
  • 2
    The register name you want is `$st0`, like in `info reg float`. Or if you're using modern SSE2 scalar math instead of legacy x87, `p $xmm0.v2_double[0]` for the low scalar double of XMM0. (Would be a duplicate of [Displaying the FPU registers in LLDB in floating point](https://stackoverflow.com/q/61648992) except it's only that question itself that starts out with an answer to your question, and is only answered in comments.) – Peter Cordes Jun 13 '22 at 09:04
  • 1
    A few of the answers on [How to print register values in GDB?](https://stackoverflow.com/q/5429137) mention ways to see all registers, which would tell you the names GCC uses for them. – Peter Cordes Jun 13 '22 at 09:11

0 Answers0