libproc: Improve .gnu_debuglink support.
authormarkj <markj@FreeBSD.org>
Tue, 6 Dec 2016 04:18:09 +0000 (04:18 +0000)
committermarkj <markj@FreeBSD.org>
Tue, 6 Dec 2016 04:18:09 +0000 (04:18 +0000)
commit55a213f57bf8facfa8b1c54e2f07e12f0bc87683
treedc1913aeaa625767646f9adebc1058b327a219cc
parent6d8ec2586741586af61beb9cadab7ba1e4514606
libproc: Improve .gnu_debuglink support.

As of r278658 libproc looks for debug files under /usr/lib/debug and will
use them if available. This change fleshes out that support a bit further:
- Check for a .gnu_debuglink section and use the file name specified
  there if one is present.
- Validate external debug files with the CRC in the .gnu_debuglink
  section so as to avoid using stale or corrupt debug files.
- Search for debug files in the directory containing the referencing
  object or in the .debug subdirectory, as GDB does.
lib/libproc/Makefile
lib/libproc/crc32.c [new file with mode: 0644]
lib/libproc/crc32.h [new file with mode: 0644]
lib/libproc/proc_sym.c