简体   繁体   English

Visual C ++,断点不会破坏

[英]Visual C++, breakpoints do not break

I have a project in Visual C++ 2010 (Win32 application, non-managed code) in which I'm experiencing a really strange behavior. 我在Visual C ++ 2010(Win32应用程序,非托管代码)中有一个项目,其中我遇到了一个非常奇怪的行为。 I put a breakpoint and it simply does not break! 我放了一个断点,它根本没有破坏!

The clues: 线索:

  • A PDB file is generated in the exe file path. 在exe文件路径中生成PDB文件。

  • The Debug/Modules window shows the message "Binary was not built with debug information.". Debug / Modules窗口显示消息“Binary未使用调试信息构建。”。

  • Loading the PDB file manually (Debug/Modules, right click on the executable module, Load Symbols From/Symbols Path then double click on the PDB file) says "A matching symbol file was not found on this folder.". 手动加载PDB文件(调试/模块,右键单击可执行模块,从符号路径加载符号然后双击PDB文件)说“在此文件夹中找不到匹配的符号文件。”。

My settings: 我的设置:

  • C++/General/Debug Information Format: Program Database. C ++ / General / Debug信息格式:程序数据库。
  • C++/Optimization: Disabled. C ++ / Optimization:已禁用。
  • C++/Code generation/Runtime library: Multi-threaded Debug. C ++ /代码生成/运行时库:多线程调试。
  • Linker/Debugging/Generate Debug Info: Yes. 链接器/调试/生成调试信息:是的。
  • Linker/Debugging/Generate program database: $(TargetDir)$(TargetName).pdb. 链接器/调试/生成程序数据库:$(TargetDir)$(TargetName).pdb。

Compiler command line: 编译器命令行:

/I"..\..\calibur64k\include" /I"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include" /Zi /nologo /W3 /WX- /Od /Oy- /D "D3D_DEBUG_INFO" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MTd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fp"Debug\calibur_app.pch" /Fa"Debug\" /Fo"Debug\" /Fd"Debug\vc100.pdb" /Gd /analyze- /Zl /errorReport:queue 

Linker command line: 链接器命令行:

/OUT:"C:\Users\David\Desktop\calibur64k\vs2010\Debug\calibur_app.exe" /INCREMENTAL:NO /NOLOGO "kernel32.lib" "user32.lib" "d3dcompiler.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" "C:\Users\David\Desktop\calibur64k\vs2010\Debug\calibur64k.lib" /MANIFEST /ManifestFile:"Debug\calibur_app.exe.intermediate.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\David\Desktop\calibur64k\vs2010\Debug\calibur_app.pdb" /ASSEMBLYDEBUG /SUBSYSTEM:WINDOWS /PGD:"C:\Users\David\Desktop\calibur64k\vs2010\Debug\calibur_app.pgd" /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE

Nothing I've found on the Internet helped me :( Any ideas guys? Thanks! 我在互联网上找到的任何东西都没有帮助我:(任何想法的人?谢谢!

The problem has been solved by trial and error :) 这个问题已经通过反复试验解决了:)

For anyone could be interested in: 任何人都可能感兴趣:

Linker/Manifest File/Generate Manifest: set it to No. Linker/Manifest File/Allow Isolation: set it to No. Linker/Embedded IDL/Ignore embedded IDL: set it to Yes. 链接器/清单文件/生成清单:将其设置为否。链接器/清单文件/允许隔离:将其设置为否。链接器/嵌入式IDL /忽略嵌入式IDL:将其设置为是。

That's it. 而已。 Maybe the generated PDB file manifest or the executable manifest were wrongly setup for a C++ project? 也许为C ++项目错误地设置了生成的PDB文件清单或可执行文件清单?

Thanks for your answers. 谢谢你的回答。

My Settings of Visual c++ 2010: 我的Visual c + + +设置:

Linker/Manifest File/Generate Manifest: Yes. 链接器/清单文件/生成清单:是的。 Linker/Manifest File/Allow Isolation: Yes. 链接器/清单文件/允许隔离:是的。 Linker/Embedded IDL/Ignore embedded IDL: No. 链接器/嵌入式IDL /忽略嵌入式IDL:否。

I have used these settings in all of my programs and break points are successfully hit. 我在所有程序中都使用了这些设置,并且成功点击了断点。

So, my inference is that what you have proposed might not be the right solution. 所以,我的推论是你提出的建议可能不是正确的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM