• vs2010调试程序出现“Cannot find or open the PDB file”


    项目中源程序编写好以后,
    (一个简单的小程序)
    #include
    int main(void)
    {
    int age;
    int day;

    age = 24;
    printf("tom is %d years old ",age);
    printf("tom has been on earth for %d days ",age*365);
    //getchar();

    return 0;
    }
    直接点击启动调试或者按F5,出现以下提示:

    “exercise3.exe”: 已加载“E:C语言学习Primer Plus第二章exercise3Debugexercise3.exe”,已加载符号。
    “exercise3.exe”: 已加载“C:WindowsSysWOW64 tdll.dll”,Cannot find or open the PDB file
    “exercise3.exe”: 已加载“C:WindowsSysWOW64kernel32.dll”,Cannot find or open the PDB file
    “exercise3.exe”: 已加载“C:WindowsSysWOW64KernelBase.dll”,Cannot find or open the PDB file
    程序“[872] exercise3.exe: 本机”已退出,返回值为 0 (0x0)。

    但是程序运行完了,主函数的返回值也为零,只是dos窗口一闪而过,并且提示以上消息。
    上网查看原因,得知是程序输出的地方是Windows系统,而不是vs2010。所以调试的话需要调用系统的一些资源,要到microsoft官网上下载,这样每次调试都比较耗费时间(操作方法:Tools---Options---Debugging---Symbols, 将microsoft symbol servers 勾选上即可),因为每次调试会从官网下载符号服务文件吧。
    解决办法,可以按control+F5直接运行,而且这样操作的话dos窗口就不会一闪而过了


    关于这个问题,visual studio工作室的人有回答,参考下文:
    Hello,
    We apologize if these messages are confusing, but is there any functionality you are expecting that is not available in the debugger? The symbol files (.pdb's) that cannot be found are the symbol files for the Windows system .dll's, and the only reason that you would need these is if you are trying to obtain complete callstacks including the Windows components, or debug into the Windows system API's. If you need the symbols, they are available from the Microsoft Public Symbol servers by checking the "Microsoft Symbol Servers" box under symbol settings (Tools -> Options -> Debugging -> Symbols). 
    However, as mentioned, unless you are unable to debug something in Windows you are expecting to be able to, there is no need to ever load these .pdb files to debug your application, and enabling the symbol servers will slow down your debugging experience since you will be loading more data into the debugging and making network call to the symbol server (this can be mitigated by enabling symbol cache on the symbol dialogue).
    Best Regards,
    Visual Studio Debugger 

    (资料参考百度知道文库和他人博客等,感谢前人的解答)
  • 相关阅读:
    Browsermob-Proxy 备忘
    Restic 备份工具
    GP刷新实体视图
    SDKMAN安装使用
    The requested module '/node_modules/.vite/vue.js?v=65afd58f' does not provide an export named 'default'
    Python——执行打包提示 ‘pyinstaller‘ 不是内部或外部命令,也不是可运行的程序
    python 打包exe 方法
    Python使用阿里云镜像
    使用Python项目生成所有依赖包的清单方式
    Git GuiUI的乱码问题如何解决
  • 原文地址:https://www.cnblogs.com/TomLily/p/5814588.html
Copyright © 2020-2023  润新知