Search code examples
delphidelphi-xe7compiler-directivesmadexcept

madExcept required compiler directives


I use madExcept (not from the IDE) but in a automated batch process.

Which compiler directives I should switch on in order to have stack trace and line numbers. I do not care about loaded modules, processes or CPU registers.

I currently run with:

{$DEBUGINFO ON}
{$LOCALSYMBOLS ON}
{$REFERENCEINFO OFF}

But would like remove as much "fat" as possible but preserve the line numbers.


Solution

  • These are the key settings:

    • Debug information (compiler options) enabled. This ensures that line number information is generated. If this option is not enabled, you will not have line numbers, only byte offsets into each function.
    • Debug information (linker options) disabled. This ensures that the executable does not contain the debug information.
    • The linker map file option set to Detailed. This ensures that the line number information is emitted in the .map file which is the information used by madExcept to convert addresses into unit names, method names, line numbers, etc.

    The local symbols and reference info options don't affect the madExcept bug reports. None of the settings you mention affect the size of the executable.