如何设置 AeDebug 以获取带有进程名称的小型转储?

发布于 2024-08-02 21:12:15 字数 307 浏览 8 评论 0原文

我必须对 C++ 项目进行一些事后调试。 已知的执行方法是将 cdb 调试器设置为小型转储生成器,然后处理收集的转储。 我几乎阅读了整个网络,但没有找到一个解决方案来生成一个带有已崩溃进程名称的小型转储

是否有一种方法可以设置 AeDebug\Debugger 注册表变量,以便 cdb 生成一个转储文件进程名称? 当我将对 cdb.exe 的调用封装在批处理文件中时,它启动良好,但在符号搜索时保持阻塞。 我必须执行 Ctrl+C 才能停止批处理,然后创建具有正确进程名称的小型转储...但当然我无法在无人值守的生产环境中设置这样的东西

...以前有人这样做过吗?

I have to perform some post mortem debugging on a C++ project.
Known way to perform is to set the cdb debugger as a minidump generator and to process the dumps collects afterwards.
I read nearly the whole web and I didn't find a solution to produce a minidump with the name of the process that has crashed

Is there a way to set AeDebug\Debugger registry variable in such a manner that cdb generates a dump file with the name of the process ?
When I encapsulate the call to cdb.exe in a batch file, it starts well but stays blocked on the symbol searching.
I must perform a Ctrl+C in order to stop the batch, then the minidump, with the correct process name, is created... but of course I can't set up such a thing in an unattended production environment...

Has anybody done that before ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

屋檐 2024-08-09 21:12:15

它开始时很好,但在符号搜索上一直受阻。

它在寻找什么?您可以执行“!symnoise”来打开有关符号加载的噪声输出。但它不应该永远阻塞——它最终应该超时。如果您修复符号路径,那也会有帮助。您可以将符号路径设置为空,这样就不可能阻止从任何地方加载符号。

关于使用进程名称生成转储,我的一位同事(Jeremy)在 cdb/ntsd 命令行上建议了这一点:

-c ".foreach( obj { lm 1m a @$exentry; } ) { .dump /m /u ${obj}.dmp;.dump /ma /u ${obj}.dmp; }; q"

他还说“确保您使用 @$exentry 而不仅仅是 $exentry,否则它会尝试使用符号解决方案并破坏你的 for 循环。”

但更简单的方法可能是使用 Windows 错误报告 (WER) LocalDumps 功能:

http://msdn.microsoft.com/en-us/library/bb787181(VS.85).aspx

将出现一个带有进程名称的目录,而不是带有进程名称的转储文件其中包含转储文件的进程名称,这可能会满足您的需求。要获得转储中的最大信息,请将 DumpType 设置为 0,并将 CustomDumpFlags 设置为 0x1B65。

请注意,此功能纯粹用于配置本地转储:“这些转储的配置和控制独立于 WER 基础设施的其余部分。即使 WER 被禁用或者如果用户取消 WER 报告。本地转储可能与发送到 Microsoft 的转储不同。”

另请注意,LocalDumps 不支持托管进程。

it starts well but stays blocked on the symbol searching.

What is it looking for? You can do "!sym noisy" to turn on noisy output about symbol loading. It shouldn't block forever, though--it should eventually timeout. If you fix your symbol path, that would help, too. You could set your symbol path to nothing, then it couldn't possibly be blocked loading symbols from anywhere.

About generating the dump with the process name, a colleague of mine (Jeremy) suggested this on the cdb/ntsd command line:

-c ".foreach( obj { lm 1m a @$exentry; } ) { .dump /m /u ${obj}.dmp;.dump /ma /u ${obj}.dmp; }; q"

And he also says "Make sure you use @$exentry and not just $exentry, else it'll attempt symbol resolution and bust your for loop."

But an easier way might be to use the Windows Error Reporting (WER) LocalDumps feature:

http://msdn.microsoft.com/en-us/library/bb787181(VS.85).aspx

Instead of a dump file with the process name, there will be a directory with the process name in it that contains the dump file, which may satisfy your needs. For maximum info in the dump, set the DumpType to 0, and CustomDumpFlags to 0x1B65.

Note that this feature is purely for configuring local dumps: "These dumps are configured and controlled independently of the rest of the WER infrastructure. You can make use of the local dump collection even if WER is disabled or if the user cancels WER reporting. The local dump can be different than the dump sent to Microsoft."

Also note that LocalDumps doesn't support managed processes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文