I'm programming a just-in-time x86-64 compiler for CIL bytecode. When my code generator emits bogus machine code, I'm forced to debug it in the disassembly window with no information about how the machine code maps to the source bytecode, making it a quite unpleasant experience.
I know that the VS disassembly window can show source code lines mappings, even for JIT compiled code as it does with .NET CLR code. The only difference is that the source code lines I want to display are not backed by any text files, though I could generate them if needed.
How can I generate the debug information needed to see source code lines in the disassembly window alongside my JIT compiled machine code?