4

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.

Gad D Lord
  • 6,620
  • 12
  • 60
  • 106

2 Answers2

3

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.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • By "Debug information enabled" do you mean Compiling | Debug Information or Linking | Debug Information. Seems like Linker is the right thing according to http://docwiki.embarcadero.com/RADStudio/XE8/en/Debug_information_(Delphi) – Gad D Lord Apr 08 '15 at 22:53
  • No, I mean the compiler setting.     The linker option controls whether or not debug info is embedded in the executable. – David Heffernan Apr 09 '15 at 05:29
1

According to the mad except help file, you should pass the -gd switch to the command line compiler in order to get a detailed map file. Don't forget to run the madExceptPatch.exe tool after compiling.

When you enable madexcept in the project options, it sets the following two compiler options:

{$DEBUGINFO 1}
{$LOCALSYMBOLS ON}
Sebastian Z
  • 4,520
  • 1
  • 15
  • 30