VisualStudio breakpoint error: The breakpoint will not be hit currently. No symbols have been loaded for this document

Reason: The currently debugged program does not match the symbol table pdb in the working directory

Symbol table.pdb and breakpoint debugging

The symbol table is a mapping table made by compiling and linking the executable file (.exe) and the source code. It stores the names and addresses of global variables and functions; the names and stack offsets of local variables; the data type definition of class and struct data;

Knowing the reason, the solution is

Solution: Make sure that the symbol table in the current working directory and the process currently being debugged are the same set

Especially the debugging method of attaching to the process, you need to find the correct process

view working directory

Solution Explorer - "Right click on the project -" Properties - "Debugging:
insert image description here

View the currently loaded symbol table

Turn on debugging-"debugging-"window-"module (or hotkey Ctrl+Alt+u)
insert image description here
and you can see the currently loaded symbol file in the "symbol file" column (symbol file)
insert image description here

Guess you like

Origin blog.csdn.net/weixin_44559752/article/details/127818683