12.07.2015 Views

MPLAB C32 C COMPILER USER'S GUIDE

MPLAB C32 C COMPILER USER'S GUIDE

MPLAB C32 C COMPILER USER'S GUIDE

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>MPLAB</strong> ® <strong>C32</strong> C Compiler User’s Guide1.8.5 Options for DebuggingThe following options are used for debugging.TABLE 1-7: DEBUGGING OPTIONSOptionDefinition-g Produce debugging information.<strong>MPLAB</strong> <strong>C32</strong> C compiler supports the use of -g with -O making itpossible to debug optimized code. The shortcuts taken byoptimized code may occasionally produce surprising results:• Some declared variables may not exist at all;• Flow of control may briefly move unexpectedly;• Some statements may not be executed because theycompute constant results or their values were already athand;• Some statements may execute in different places becausethey were moved out of loops.Nevertheless it proves possible to debug optimized output. Thismakes it reasonable to use the optimizer for programs that mighthave bugs.-Q Makes the compiler print out each function name as it iscompiled, and print some statistics about each pass when itfinishes.-save-tempsDon’t delete intermediate files. Place them in the currentdirectory and name them based on the source file. Thus,compiling foo.c with -c -save-temps would produce thefollowing files:foo.i (preprocessed file)foo.s (assembly language file)foo.o (object file)DS51686A-page 26© 2007 Microchip Technology Inc.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!