What problems cause Visual Studio to say "Source information is missing from the debug information for this module"?
Asked Answered
T

0

11

I'm working on a compiler for the CLR, and I mostly have it working. I'm trying to generate debug information, and I can get it to create an embedded PDB in the generated assembly where all the debug metadata looks right. When I load the assembly, the Modules view says "Symbols loaded." But I can't get the debugger to recognize breakpoints, and if I throw an exception inside the code, it says,

Source Not Available

Source information is missing from the debug information for this module.

When I look at the assembly in DotPeek, it does not say "Debug" on the assembly's main name line, the way it does for C# assemblies built with debug information. I'm not sure what's missing, though.

What can cause this error to come up? In case anyone needs a test case to look at, here's one.

EDIT: Please read the question and take note of the Tags. I've gotten a couple different answers on here that are bog-standard "how to get PDBs to load under normal circumstances" answers. This question is not about normal circumstances. I am building the compiler and it is generating incorrect PDBs. I need a way to debug the output of the PDB code that I am generating myself.

Thralldom answered 9/1, 2022 at 1:52 Comment(1)
There are several other questions asking about this error. As near as I can tell, this is not a duplicate of any of them, as they're all about troubleshooting third-party software that they can't debug, whereas in mine I'm the one who created the debug information and I'm trying to fix my own codegen.Thralldom

© 2022 - 2024 — McMap. All rights reserved.