visual-studio-debugging

What is different between visual studio F5, ctrl+F5, or running outside of visual studio?

寵の児 提交于 2019-11-30 14:40:05
问题 I have written a program in vc++ that has different behavior in various case as below. When I run it by F5 it works properly in release mode. When I run it by ctrl + F5 it crashes when I start to send data to the program. Outside of visual studio it crashes immediately. I don't know how to find the bug. Any idea on what is different between these cases? 回答1: Running ctrl + F5 will run the application without debugger. (http://msdn.microsoft.com/en-US/library/8b59xk0f(v=vs.90).aspx) This is

How does Visual Studio know if the source file matches the original version?

Deadly 提交于 2019-11-30 13:11:51
问题 I figured out how a .NET assembly .dll file maps to a .pdb using a GUID (blog). When I debug into an assembly and it asks for the source code, if I navigate to a file, it may tell me that the source code is different from the original. How does it know this? I was expecting the .pdb file to contain a checksum for each file, but it doesn't appear to. The best tool I found to dump the debug information is dia2dump. The C++ .pdb files had MD5 entries, but the C# .pdb files did not. C++ dump

Cannot debug application in release mode even with DebugType=full

醉酒当歌 提交于 2019-11-30 13:02:49
We are building a solution for Release, but when attempting to attach using studio 2010 professional, no thread is showing any stack information, nor any breakpoint can be set, etc. The goal is to be able to attach the Visual Studio/JIT Debugger to the running process while having as many optimization benefits as possible. Most of our searches comes down to 'compile with debug:full' and you will be able to debug, but that doesn't seem to be the case, I thing that the JIT optimizes the code in runtime and thus we cannot debug, is this true? Is it possible to compile and tell the JIT to downplay

What is different between visual studio F5, ctrl+F5, or running outside of visual studio?

≡放荡痞女 提交于 2019-11-30 11:16:16
I have written a program in vc++ that has different behavior in various case as below. When I run it by F5 it works properly in release mode. When I run it by ctrl + F5 it crashes when I start to send data to the program. Outside of visual studio it crashes immediately. I don't know how to find the bug. Any idea on what is different between these cases? Markus Running ctrl + F5 will run the application without debugger. ( http://msdn.microsoft.com/en-US/library/8b59xk0f(v=vs.90).aspx ) This is not the same as running in release mode. You can run your application in debug mode but without

How to debug Visual Studio 2012 instance design-time

六月ゝ 毕业季﹏ 提交于 2019-11-30 08:31:47
I'm developing a WPF MarkupExtension and encountered errors during design time. With the previous version of Visual Studio 2010 it was possible to start a second instance of Visual Studio 2010 and attach to the process of the already-running instance, setting breakpoints and debugging the design time behavior. In Visual Studio 2012 however I can attach to the process of another Visual Studio 2012 as well, but no symbols are loaded in the second instance and therefor I'm not able to debug the design time as with Visual Studio 2010. How do I get this debugger running? Things I've tried: "devenv

Visual studio 2012 and Qt4.8.5 : How to see QString contents in debug mode.

ぃ、小莉子 提交于 2019-11-30 06:42:00
I use visual studio 2012 and Qt4.8.5, unfortunately I can not see the QString text variable when I work in debug mode. Is someone has a tip allow it ? Qt4.8.5 plug-in doesn't exist for VS2012. Thank a lot Xavier There is a quick and explicit solution (MSVC native, no need for plugins nor setting up .dat files), see my answer from here Say you have QString str ( Qt4 ), then add to the debugger watch window: ((str).d)->array,su the appendix ,su tells the debugger to interpret the data as unicode and null terminated string. Note : For a Qt5 QString str it could be (char*)str.d + str.d->offset,su

How does Visual Studio know if the source file matches the original version?

醉酒当歌 提交于 2019-11-30 06:36:59
I figured out how a .NET assembly .dll file maps to a .pdb using a GUID ( blog ). When I debug into an assembly and it asks for the source code, if I navigate to a file, it may tell me that the source code is different from the original. How does it know this? I was expecting the .pdb file to contain a checksum for each file, but it doesn't appear to. The best tool I found to dump the debug information is dia2dump . The C++ .pdb files had MD5 entries, but the C# .pdb files did not. C++ dump dia2dump -f dia2dump.pdb > dia2dump.pdb.files.txt C# dump dia2dump -f Autofac.pdb > Autofac.pdb.files

StackTrace/StackFrame don't return expected info in a production environment

依然范特西╮ 提交于 2019-11-30 05:25:42
I use the following method in my ASP.NET web application to receive the stack trace for an exception: public static void getStackTraceInfo(System.Diagnostics.StackTrace trace) { for (int i = 0; i < trace.FrameCount; i++) { int nLine = trace.GetFrame(i).GetFileLineNumber(); int nCol = trace.GetFrame(i).GetFileColumnNumber(); string methodName = trace.GetFrame(i).GetMethod().Name; } } try { } catch(Exception ex) { getStackTraceInfo(new System.Diagnostics.StackTrace(ex, true)); } It gives me full line/column/method name information if I run it in the Visual Studio 2010 dev environment, but in a

C# VS2010 Entering break mode failed

大兔子大兔子 提交于 2019-11-30 02:52:54
I was having some problems with my breakpoints later in my program saying that they would not be hit because the source code and the compiled code was different. I decided to put a break point on my public MainWindow() function, and see what happened. Now I get the error that Entering break mode failed for the following reason: Source file 'F:\cAdmin\OO\OO\MainWindow.xaml.cs' does not belong to the project being debugged. I find this funny because my project is stored on my flash drive (L:) and not F:. I have rebuilt my project and cleaned it (many times), restarted my computer, moved my Flash

Visual Studio - suddenly cannot debug tests

与世无争的帅哥 提交于 2019-11-30 01:14:22
I'm not sure what I did, but all of a sudden, my Visual Studio 2012 will not debug any tests. If I select a test from the Test Explorer and tell it to run, it simply outputs this in the Test Output window: > ------ Discover test started ------ > ========== Discover test finished: 29 found (0:00:01.3371755) ========== > ------ Run test started ------ Process with an Id of -1 is not running. > ========== Run test finished: 0 run (0:00:01.4711861) ========== what the heck does that mean?! After doing this a few times, the error changed to: The Operation was Cancelled which I sure didn't do. It's