首页 文章

“断点当前不会被命中” - 我无法添加.pdb文件

提问于
浏览
10

我在Visual Studio 2013 (Visual C++) 中有一个项目的解决方案 .

但是当我在 debug 模式下构建它时,我得到了: run it in debug 模式:

断点当前不会被击中 . 没有为此文档加载任何符号 .

我试图以类似的方式修复它,以便人们为Visual C提出建议#Fixing "The breakpoint will not currently be hit. No symbols have been loaded for this document."

不幸的是, none 的工作原理:

  • 清理和重建解决方案(也包含手动删除的临时文件),

  • solution -> Properties -> Startup Project -> startup projects -> Start action

  • Debug/General settings - >取消选中 Just My Code

  • 退出VC,重新加载,重新启动PC .

然后我尝试用 Debug -> Windows -> ModulesRMB -> Load symbols 选择 .pdb 文件(在 clear, rebuild 之后) . v120.pdb 位于 /Solution/Debug 文件夹中, .exe 位于 /Bin 文件夹中 . 我选择了它并收到错误消息:

在此文件夹中找不到匹配的符号文件 .

What else can I do? 哪些解决方案/项目选项可能影响调试?我构建了一个 x86 .exe 项目,其中包含一些我的 .lib 文件(但调试在 main.cpp 中也不起作用) .


其他信息(一些用户在评论中要求):

我看到 Debug -> Windows -> Modules 下有 .exe 这样的条目:

Project.exe F:... exe N / A N / A Binary没有使用调试信息构建 . 1 12/15/2014 12:31 PM 00BA0000-00E9C000 [3504] Project.exe

这很奇怪因为 main.cpp 文件夹 is being created each time I hit Rebuild 用于 Debug 模式,所以我也得到了新的 .pdb 文件 . 我正在运行选择了 Debug 模式的应用程序 .


Project -> Properties -> C/C++ -> General -> Debug Information Format 的值为 Program Database for Edit And Continue (/ZI) .

1 回答

  • 11

    看起来你没有正确生成模块窗口告诉你的调试信息 . 确保已设置以下属性:

    Project -> Properties -> C/C++ -> General -> Debug Information Format

    Project -> Properties -> Linker -> Debugging -> Generate Debug Information.

    这些有时会偶然发生变化 .

    除非你有自定义的构建解决方案,否则我从来没有看到这些信息在没有正当理由的情况下丢失

相关问题