Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Debugging Ports ====== ===== Enabling Debugging During Build ===== Whether ports are built with debugging symbols can be controlled by the settings in /etc/make.conf. Enable debugging for all ports: <code> WITH_DEBUG= yes </code> Enable debugging for select ports: <code> WITH_DEBUG_PORTS= mail/dovecot security/krb5 </code> 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: <code> DEBUG_FLAGS= -g -O0 </code> This will instruct the compiler to: * -g: Generate debug information * -O0: Disable compiler optimizations ===== Checking Debugging Symbols ===== After a port has been built with the above debugging steps, you can check they have worked by using file(1) to analyze the installed binaries. <code> $ file /usr/local/sbin/dovecot /usr/local/sbin/dovecot: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 12.0 (1200054), FreeBSD-style, with debug_info, not stripped </code> Note that this file has debug_info and is not stripped. debuggingports.txt Last modified: 2023/05/08 16:53by DanielEbdrup