Saturday, 15 June 2013

c++ - Visual Studio - Call stack does not trace back to user function -


Participated in some access violations in Visual Studio 2010 and there is a callstack:  Enter image details here

Most call stack DLLs have assembly codes (almost unclear to me). I want to trace back to my code in the line which caused the violation, but it seems that there is no user function in the call stack.

How can I get a line in my function due to violation? Do I need to adjust some settings?

It is difficult to obtain a trusted stack trace from the customized C or C ++ code. The Optimizer chooses speed over diagnostics, debugger needs PDB files for this code, to know how to define stack frames properly and to detect the return in the calling method.

Obviously you do not have these PDBs, you are getting raw addresses. Operating system DLLs, rather than their function names, it is quite easy to get those PDBs, Microsoft has a public server For any released version, those PDBs are saved, including service packs and security updates.

The debugger is required to tell about that server, the feature is turned off by default, it is especially easy for VS2010, the program is already programmed in the name dialog, you can only turn it on You must do the tool + option, debugging, symbol, check the checkbox in front of "Microsoft Signal Server", set the cache directory, what any writable directory will do.

Start debugging again, it will take some time before caching PDBs. When this is done, you will see a very improved stack trace. Accurate and with function names of Windows DLL.

No comments:

Post a Comment