繁体   English   中英

在Visual Studio中使用本地Windows调试器运行了第一个程序。 输出窗口显示大量“找不到或打开PDB文件”

[英]ran first program with local windows debugger in visual studio. Output window displays numerous “Cannot find or open the PDB file”

我是C ++的全新用户,当我运行如下所示的程序时,我在输出窗口中收到一堆输出(抱歉,持续了多长时间)。 我的简单程序运行正常,但是当我编写更高级的c ++程序时,这会成为问题吗? 更重要的是,我该如何解决? 谢谢。 继承人的输出:

'First Try.exe' (Win32): Loaded 'C:\Users\isaiah\C++\Isaiahs Programs\First Try\Debug\First Try.exe'. Symbols loaded.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\WRusr.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\psapi.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ws2_32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\urlmon.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wininet.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleacc.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\secur32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msimg32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\combase.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\nsi.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\iertutil.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\userenv.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\profapi.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\SHCore.dll'. Cannot find or open the PDB file.

而我谦虚的程序:

#include <iostream>
#include <string> 

using namespace std;

int main()
{
string name;

cout<< "Enter your name: ";
cin >> name;
cout << "Hello " << name << endl;

return 0;
}

要添加@Marco已经编写的内容,您看到的警告是因为Visual Studio无法看到系统dll的调试信息(“符号”)。 通常,这不应影响您的日常开发,但有时获取其他信息会非常有用,例如,如果您必须修复系统代码中发生的崩溃(例如,无效的参数,或者您有重复删除操作)。 如果没有符号,那么您将在调用堆栈中看到类似以下内容的内容:

> 0x267823af
  0x27658abc
  0x36726812
  MyBrokenFunction() 

但是,在Visual Studio 2010和更高版本中,有一个非常有用的选项,您可以在其中打开“ Tools -> Options -> Debugging -> Symbols然后选中该选项以使用Microsoft Symbol Server。 下次调试时,它将加载许多系统符号(警告:调试器似乎已挂起,但正在下载,请耐心等待)。 然后将它们缓存下一次。 现在,您将获得完整的通话堆栈。

只是开个玩笑:您看到的输出是Visual Studio无法找到这些模块的“符号数据库”。 Visual Studio使用它们自己的格式

在调试代码时会使用符号,通常无法找到那些不是您自己编写的模块的符号,或者是无法像操作系统提供的那样以“常规方式”进行调试的符号。

如果您看一下第一行:您的程序已加载了符号,这意味着您将能够将源代码行和构造与机器将执行的内容相关联(这将对确定正在解释的内容非常有用)如果遇到错误,则错误)。

您不必担心其他模块没有符号。

小提示:通常有两种(或更多)编译模式

  • 调试
  • 发布

第一种表示“用调试符号生成可执行文件”,而将产生很少的优化(因此也较慢)的更大的可执行文件,第二种表示“不生成调试符号,只是使程序快而小。”将其部署到最终最终用户”。

暂无
暂无

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

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