These parts of the function will also be needed when parsing separate
debug files, so extract them to new internal functions that can be
reused when doing so in a future commit.
As part of this, fix up all the warning messages to use the right path
when fd refers to FSROOT/boot/modules/NAME; previously it always used
the FSROOT/KERNELPATH/NAME string which could get confusing. Also fix a
style issue for the done label.
MFC after: 1 month