在Windows minidump文件中嵌入线程名称

编程入门 行业动态 更新时间:2024-10-12 03:23:27
本文介绍了在Windows minidump文件中嵌入线程名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我们的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文件中嵌入线程名称

本文发布于:2023-11-07 02:03:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1565259.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:线程   名称   文件   Windows   minidump

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!