71b2141ae6
The kernel build uses symlinks to make MD #includes like <machine/pcpu.h> work. Debug info ends up referencing these symlinks in a relative path, so debuggers generally don't know how to find the corresponding headers. Address this by using -fdebug-prefix-map to map relative paths through the symlinks to their absolute paths in the source tree. This is consistent with how regular source file paths are defined in the kernel's debug info. Also map the current directory to an absolute path to the object directory. This gives debuggers a chance to find auto-generated files like vnode_if.c if the object directory is available. Reviewed by: emaste, jhb (previous version) MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19633