Compiler.java: adds options to support -W,-Wall flags, .map file and .lst file generation, avr-size output #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch adds 4 preferences.txt options to support enabling -W and -Wall
flags when compiling, producing a .map file as part of the linking stage,
producing a diassembly list file after linking, and a more verbose size output.
Adding 'compiler.show_all_warnings=true' to preferences.txt adds the -W and
-Wall flags passed to the compiler, and removes the -w flag. This produces
informative verbose warnings about less than ideally constructed code, such as
signed vs unsigned comparisons, unused variables, and a great deal of other
useful information.
Adding 'compiler.map_file=true' causes the linker to produce a detailed map
file listing of the code. This file is written to the directory the sketch is
located in.
Adding 'compiler.lst_file=true' causes avr-objdump to be run on the produced
.elf file. The listing file contains a disassembled listing of the code
intermixed with the source code. The -d (Display assembler contents of
executable sections) and -S (Intermix source code with disassembly) options are
passed to avr-objdump. The resulting .lst file is written to the directory the
sketch is located in.
Adding 'compiler.detailed_size' causes avr-size to be run on the produced .elf
file. This displays a more detailed report the combined sizes of the program
space (.text + .data + .bootloader), and the combined sizes of data space
(.data + .bss + .noinit)
Unfortunately, avr-objdump does not support a command line option to specify
where to write the output of the program to. Instead, EVERYTHING goes to
stdout. Normally anything written to stdout by an exec'ed program is written
to the status window of the Arduino IDE. To get the the stdout of avr-objdump
captured to be written to an output file required a tad bit hackishness in the
execAsynchronously function. See source for details.