In x86 builds, we write a FrameData subsection to the COFF object file, that is used to help in unwinding. However, we weren't writing any of this data to the PDB. This would cause incorrect local variable display when debugging 32-bit binaries in certain scenarios. This patch emits the fpo data stream.
I confirmed using the reproducer from https://bugs.llvm.org/show_bug.cgi?id=38857 that without my patch, local variable display is garbage, and after my patch local variable display is correct.
There are two fixups that need to be done on a FrameData record before copying it to the PDB. The first is that the object file contains a relocation offset for each group of frame data entries. That needs to be added to each entry's RVA before writing it. The second is that the FrameData has a field which refers to the object file's local string table. This needs to be translated into an offset that is valid in the PDB's merged / global string table. All of the other fields can just be copied over.
I also added facility to llvm-pdbutil to dump the fpo data, and confirmed that we output data matching cvdump -fpo given the same PDB.