简体   繁体   English

C ++:指向库“ lib”文件中的BreakPoint

[英]C++ : BreakPointing into into library “lib” files

I currently have a project say projA that uses a library project that I created. 我目前有一个项目projA ,它使用我创建的库项目。 Now here is the scenario. 现在是方案。 I have two instances of Visual Studio open: instance one and instance two. 我有两个打开的Visual Studio实例:实例一和实例二。 One instance fires up projA and other has the library solution loaded up with breakpoints set. 一个实例启动projA ,另一个实例加载了设置了断点的库解决方案。 Nothing else is done at instance two. 在第二个实例上什么也没做。 Now here is the problem when projA (instance one of VStudio) starts the breakpoints in the other instance of visual studio are never triggered. 现在,当projA (VStudio的一个实例)启动Visual Studio另一个实例中的断点时,永远不会触发该问题。 The only way through which I could step through the library code is to break-point into the function that calls the library code in projA (instance one) and then step into the library code which also opens up code from the library in instance one. 我可以单步执行库代码的唯一方法是转入函数,该函数在projA (实例1)中调用库代码,然后步入库代码,该代码也从实例1中的库中打开代码。 What I want to do is put breakpoints in instance 2 and have breakpoints triggered there. 我想做的是在实例2中放置断点,并在其中触发断点。 Any suggestions ??? 有什么建议么 ???

Set the breakpoint in the VS instance that's debugging the EXE. 在调试EXE的VS实例中设置断点。 All your breakpoints should be set in the same instance. 您所有的断点都应在同一实例中设置。 Even if the source code is not part of the open project, Visual Studio uses the debugging symbols to know where your source files are. 即使源代码不属于打开的项目,Visual Studio也会使用调试符号来了解源文件的位置。 So, you can open a source file and set a breakpoint in the other instance. 因此,您可以打开源文件并在另一个实例中设置一个断点。

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

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