4.5. Inspecting generated C code

Common-Lisp defines a function disassemble, which is supposed to disassemble a compiled function and to display the assembler code. According to Common-Lisp: The Language,

This is primary useful for debugging the compiler, ..\\

This is, however, useless in our case, because we are not concerned with assembly language. Rather, we are interested in the C code generated by the ECL compiler. Thus the disassemble function in ECL accepts not-yet-compiled functions only and displays the translated C code.

   > (defun add1 (x) (1+ x))
   ADD1
   > (disassemble *)
   ;;; Compiling (DEFUN ADD1 ...).
   ;;; Emitting code for ADD1.

   /*      function definition for ADD1                                  */
   static L1(int narg, object V1)
   { VT3 VLEX3 CLSR3
   TTL:
   VALUES(0) = one_plus((V1));
   RETURN(1);
   }