Kernel debugging is relatively easy to set up: See Michal's
http://www.os2museum.com/wp/kernel-debugging-with-virtualbox/Virtualbox also has it's own GUI debugger
https://www.virtualbox.org/manual/ch12.html#ts_debuggerAlthough probably not all that useful for this endeavor, pmmerge implements a trace facility.
From my notes:
Pmmerge implements the function.
PMTrace(mask, force, requestlevel, filename, lineno, messsage)
Formats and writes records to FFST and COM port depending on settings.
Output is controlled by PM_DEBUG environment variable.
Format is
SET PM_DEBUG=gbllevel,level0,...level31
Level values are 1 to 15
Levels are limits
Output occurs if request less than or equal limit
gbllevel applies to all
level0 applies if bit 0 set in mask, etc.
Generally SET PM_DEBUG=15 is sufficient.