我们的32位C ++应用程序在Windows上使用标准方法来命名其线程.当发生错误时,我们会生成小型转储,但是当转储加载到Visual Studio 2013中时,线程名称会丢失.鉴于存在大量线程,这使得调试问题变得更加困难.
Our 32-bit C++ application names its threads using the standard approach on Windows. We generate minidumps when errors occur, but when the dumps are loaded into Visual Studio 2013 the thread names are missing. This makes it harder to debug the problem given the high number of threads present.
我听说改善此问题的唯一方法来自此 Microsoft用户语音发布,调用者建议将其嵌入自定义流中,并编写自定义Visual Studio扩展以在加载线程时重命名线程倾倒.但是,这似乎很麻烦,而且显然会增加加载过程的时间.
The only way I've heard of to improve this comes from this Microsoft User Voice posting, where the caller suggests embedding them in a custom stream, and writing a custom Visual Studio extension to rename the threads upon loading the dump. However, this seems cumbersome and apparently adds a lot of time to the loading process.
是否有更简单的方法将线程名称嵌入转储中,以便在Visual Studio中加载它们时可以正常工作"?
Is there an easier way to embed thread names in the dump so they "just work" when loading them in Visual Studio?
供参考:我们使用Visual Studio 2013进行构建,我们的应用程序在Win7或更高版本上运行,并且我们使用Google Breakpad生成转储.
For reference: we use Visual Studio 2013 to build, our apps run on Win7 or higher, and we use Google Breakpad to generate dumps.
推荐答案Microsoft表示 SetThreadDescription API 将成为它们将来为转储,调试器和/或分析工具中的线程名称添加任何适当支持的基础.
Microsoft has indicated that the SetThreadDescription API will be the basis for any proper support they add in the future for thread names in dumps, debuggers, and/or analysis tools.
不幸的是,此API似乎很新,并且转储,WinDbg,Visual Studio Debugger等尚不支持.有添加此支持的用户语音请求,请对此投票如果您想要一种适当地给线程赋予永久名称的方法.
Unfortunately it appears that this API is rather new and is not yet supported in dumps, WinDbg, Visual Studio Debugger, etc. There is a User Voice request to add this support, so please vote for it if you would like a way to properly give threads a persistent name.
更多推荐
在Windows minidump文件中嵌入线程名称
发布评论