debuggingports

This is an old revision of the document!


Debugging Ports

Whether ports are built with debugging symbols can be controlled by the settings in /etc/make.conf.

Enable debugging for all ports:

WITH_DEBUG=	yes

Enable debugging for select ports:

WITH_DEBUG_PORTS=	mail/dovecot security/krb5

If debugging is enabled for a specific port, the ports system will:

  • Add DEBUG_FLAGS (defaults to -g) to CFLAGS
  • Tries to prevent the binaries from being stripped (including checking the install target to replace “install-strip” with “install”)

To customize the changes to CFLAGS in debugging mode:

DEBUG_FLAGS=	-g -O0

This will instruct the compiler to:

  • -g: Generate debug information
  • -O0: Disable compiler optimizations
  • debuggingports.1518178314.txt.gz
  • Last modified: 2018/02/09 12:11
  • by BenWoods