简体   繁体   English

Visual Studio 有时加载符号,有时不加载

[英]Visual studio SOMETIMES loads symbols and sometimes does not

I am working on a code in c++.我正在使用 C++ 编写代码。 This code is compiled into a dll file which is loaded by a java application.这段代码被编译成一个由java应用程序加载的dll文件。 When debugging, I normally run the application (from Eclipse) and attach to javaw.exe process in Visual studio 2017. This worked fine for a long time until I got a new computer (with same operating system, windows 10, as the previous one).调试时,我通常运行应用程序(从 Eclipse)并附加到 Visual Studio 2017 中的 javaw.exe 进程。这在我得到一台新计算机(与上一个操作系统相同,Windows 10)之前一直运行良好)。 On this new computer I use the same procedure to attach and debug, but randomly I get warnings that symbols are not loaded and breakpoints will not be hit.在这台新计算机上,我使用相同的程序进行连接和调试,但我随机收到警告,提示未加载符号且不会命中断点。 In this case I close the application, open it again, attach, and everything works fine.在这种情况下,我关闭应用程序,再次打开它,附加,一切正常。 I do not know exactly where the symbols are, and what is the problem, but it is annoying to have to close and reopen the application.我不知道符号的确切位置,以及问题是什么,但不得不关闭并重新打开应用程序很烦人。 Any ideas on what might be the reason for this issue and how it can be resolved?关于此问题的原因以及如何解决的任何想法?

Also I do not know what further information I can provide, but if you could think of anything that might help, please ask.此外,我不知道我可以提供哪些进一步的信息,但如果您能想到任何可能有帮助的信息,请询问。 Thanks.谢谢。

I know there are many questions about loading symbols and hitting breakpoints, but so far I could not find an answer that solves my problem.我知道有很多关于加载符号和打断点的问题,但到目前为止我找不到解决我问题的答案。

in the "Attach to Process" window (Debug>>Attach to Process), the "Attach to:" field is set to "Automatic" by default.在“附加到进程”窗口(调试>>附加到进程)中,“附加到:”字段默认设置为“自动”。

In my case, I was debugging native code, but there were some small parts of the big project that dealt with exporting to/importing from excel.就我而言,我正在调试本机代码,但是大项目的一些小部分处理了从 excel 导出/导入的问题。 So visual studio sometimes (specially when the app had just loaded) categorized the project that I was attaching to as Native (in this case breakpoints worked fine), and sometimes recognized my project as Managed (in this case it could not load symbols).因此,visual studio 有时(特别是当应用程序刚刚加载时)将我附加到的项目归类为 Native(在这种情况下断点工作正常),有时将我的项目识别为托管(在这种情况下它无法加载符号)。

As I knew that I was debugging the Native code all the time, I changed the "Attach to:" field to "Native" and now it works as desired.因为我知道我一直在调试本机代码,所以我将“附加到:”字段更改为“本机”,现在它可以正常工作了。

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

相关问题 Visual Studio 2012 Professional无法识别类 - 有时候 - Visual Studio 2012 Professional doesn't recognize a class - sometimes 静态库中的符号有时会链接到可执行文件中,有时不会 - symbols in static library sometimes got linked into executable, sometimes not Select()有时不等待 - Select() sometimes does not wait Visual Studio没有加载符号 - Visual Studio No symbols loaded Visual Studio ctrl-H有时不会自动选择“选择” - Visual Studio ctrl-H sometimes doesn't automatically select 'selection' C ++相同的代码永远不会在Visual Studio中编译/运行,有时甚至不会在Qt Creator中运行 - c++ same code compiles/runs never in Visual Studio and sometimes in Qt Creator Visual Studio 2012 C ++调试器无法启动:加载符号 - Visual Studio 2012 C++ Debugger does not start: loading symbols Visual Studio“对象文件未定义任何以前未定义的符号” - Visual Studio “object file does not define any previously undefined symbols” 为什么Clang有时会返回nullptr,有时会返回我想要的? - Why does Clang returns sometimes nullptr, sometimes what I want? 为什么我的Winsock应用程序有时会在listen()有时在accept()上等待? - Why does my Winsock app sometimes wait at listen() and sometimes at accept()?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM