12.10 Use of gdb to Debug the FPU Operations

The GNU debugger gdb is a very useful utility on Unix-like systems for debugging C, C++, assembly language and some other programs (with limitations). Our interest in it arises because we are using floating-point instructions to implement many of the constructs in miniC and gdb has good facility for monitoring the activity of the x86 FPU.

We do not plan to discuss here the full working of GNU gdb, but we demonstrate only its usefulness for checking and debugging the floating-point code generated by our compiler. We used gdb extensively while developing the action terms (attribute rules) in the miniC yacc grammar, the code generator and the assembly language built-in library. We shall demonstrate the ...

Get Compilers: Principles and Practice now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.