#if DEBUG vs if (env.IsDevelopment())

Preprocessor directives are conditionally compiled… Which means that something like this: #if DEBUG //Do something #endif Will only be compiled and checked if the DEBUG symbol is defined (it is defined when the build is set to DEBUG). Additionally, in the IDE the code between the preprocessor symbols will appear greyed out. This code: if … Read more

Visual Studio 2012 Website Publish Not Copying .pdb files

In VS2012 Website publishing, symbols are always excluded by default. Why? It comes down to a design issue where website projects don’t actually have a build configuration. If you look at the configuration manager in VS when your solution is in Release mode, the website project will always be in Debug mode; there are no … Read more

Visual Studio: debug information in release build

The size of the executable should increase much less than 25%. I’m actually a little surprised that it increases much at all, but some quick tests show that at least one large example project (ScummVM) increases the .exe from 10,205,184 bytes to 10,996,224 bytes just by adding the /DEBUG option to the link step (about … Read more

Getting Symbols from debugged process MainModule

can it be that you are looking for System.Diagnostics.SymbolStore.ISymbolScope. Have a look at the class SymbolAccess, you can use it to gain access to ISymbolScope.GetLocals() that returns ISymbolVariable[] and GetChildren() again returning in this time an array called ISymbolVariable[] Now another interesting set of reference code samples is the Debugger extension lets you “snif” the … Read more

How do debug symbols affect performance of a Linux executable compiled by GCC?

The debug symbols are located in totally different sections from the code/data sections. You can check it with objdump: $ objdump -h a.out a.out: file format elf64-x86-64 Sections: Idx Name Size VMA LMA File off Algn 0 .interp 0000001c 0000000000400200 0000000000400200 00000200 2**0 CONTENTS, ALLOC, LOAD, READONLY, DATA 1 .note.ABI-tag 00000020 000000000040021c 000000000040021c 0000021c 2**2 … Read more

Xcode 4 archive warning to skip copy phase

The solution would be to go to the build settings of your application target (not the help tool target) and set “Strip Debug Symbols During Copy” to “No”. This is the key COPY_PHASE_STRIP. Activating this setting causes binary files which are copied during the build (e.g., in a Copy Bundle Resources or Copy Files build … Read more