Further refactoring of AddressTranslate for FreeBSD
authorDan McNulty <mcnulty@cs.wisc.edu>
Fri, 4 Jun 2010 21:28:14 +0000 (16:28 -0500)
committerDan McNulty <mcnulty@cs.wisc.edu>
Fri, 4 Jun 2010 21:28:14 +0000 (16:28 -0500)
commit3161614b6aad9bcfcff3e4354e03aa0c032c7d9b
tree98cd432195f9b72ce7b03ac0b3582eef4f5d14db
parenta1a35d7731f07fb7fc5321b30e034a6192607e9b
Further refactoring of AddressTranslate for FreeBSD

A newly created process doesn't have the DT_DEBUG field populated, so
changes were made to lazily parse this field. However, the trap address
needs to be known immediately after an AddressTranslator is created.
Luckily on FreeBSD, there is a symbol in the dynamic linker for the trap
address.

If DT_DEBUG is unavailable, the trap address is parsed from the dynamic
linker. If DT_DEBUG is available, the trap address is parsed from the
r_debug structure.

Consequently, to parse the dynamic linker, we need to know its base
load address in memory. This can be retrieved from memory maps. This
has been implemented for FreeBSD and doesn't require procfs. This
required some refactoring of the existing memory map parsing support
on Linux.

On another note, plat_install in ProcControlAPI was factored to
sysv.C because the functionality is the same on both Linux and FreeBSD.
24 files changed:
common/amd64-unknown-freebsd7.2/Makefile
common/h/Types.h
common/h/freebsdKludges.h
common/h/linuxKludges.h
common/h/parseauxv.h
common/i386-unknown-linux2.4/Makefile
common/ia64-unknown-linux2.4/Makefile
common/ppc32-unknown-vxworks6.x/Makefile
common/ppc32_bgp_ion/Makefile
common/ppc32_linux/Makefile
common/ppc64_linux/Makefile
common/sparc-sun-solaris2.8/Makefile
common/sparc-sun-solaris2.9/Makefile
common/src/addrtranslate-auxv.C [moved from common/src/addrtranslate-interp.C with 58% similarity]
common/src/addrtranslate-freebsd.C
common/src/addrtranslate-sysv.C
common/src/addrtranslate-sysv.h
common/src/freebsdKludges.C
common/x86_64-unknown-linux2.4/Makefile
common/x86_64_cnl/Makefile
proccontrol/amd64-unknown-freebsd7.2/Makefile
proccontrol/src/freebsd.C
proccontrol/src/linux.C
proccontrol/src/sysv.C