<legend id='CYZ8e'><style id='CYZ8e'><dir id='CYZ8e'><q id='CYZ8e'></q></dir></style></legend>
    <i id='CYZ8e'><tr id='CYZ8e'><dt id='CYZ8e'><q id='CYZ8e'><span id='CYZ8e'><b id='CYZ8e'><form id='CYZ8e'><ins id='CYZ8e'></ins><ul id='CYZ8e'></ul><sub id='CYZ8e'></sub></form><legend id='CYZ8e'></legend><bdo id='CYZ8e'><pre id='CYZ8e'><center id='CYZ8e'></center></pre></bdo></b><th id='CYZ8e'></th></span></q></dt></tr></i><div id='CYZ8e'><tfoot id='CYZ8e'></tfoot><dl id='CYZ8e'><fieldset id='CYZ8e'></fieldset></dl></div>

      <small id='CYZ8e'></small><noframes id='CYZ8e'>

      • <bdo id='CYZ8e'></bdo><ul id='CYZ8e'></ul>
    1. <tfoot id='CYZ8e'></tfoot>

      在进程外使用 MiniDumpWriteDump 时如何获取异常信息

      时间:2023-10-06

            1. <small id='LgUsE'></small><noframes id='LgUsE'>

              <i id='LgUsE'><tr id='LgUsE'><dt id='LgUsE'><q id='LgUsE'><span id='LgUsE'><b id='LgUsE'><form id='LgUsE'><ins id='LgUsE'></ins><ul id='LgUsE'></ul><sub id='LgUsE'></sub></form><legend id='LgUsE'></legend><bdo id='LgUsE'><pre id='LgUsE'><center id='LgUsE'></center></pre></bdo></b><th id='LgUsE'></th></span></q></dt></tr></i><div id='LgUsE'><tfoot id='LgUsE'></tfoot><dl id='LgUsE'><fieldset id='LgUsE'></fieldset></dl></div>
                <bdo id='LgUsE'></bdo><ul id='LgUsE'></ul>
                <tfoot id='LgUsE'></tfoot>

                <legend id='LgUsE'><style id='LgUsE'><dir id='LgUsE'><q id='LgUsE'></q></dir></style></legend>

                  <tbody id='LgUsE'></tbody>
                本文介绍了在进程外使用 MiniDumpWriteDump 时如何获取异常信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                在 Windows 上使用 MiniDumpWriteDump 函数创建进程的核心转储时,建议使用(例如 这里 和这里)MiniDumpWriteDump 是从另一个看门狗"进程运行的,因为在同一进程中调用时它可能无法正常工作.

                When using the MiniDumpWriteDump function to create a core dump of a process on Windows, it is recommended (e.g. here, and here) that the MiniDumpWriteDump is run from another "watchdog" process because it may well not work when called from within the same process.

                目前,我们的应用程序在处理未处理的异常时调用它(我们从看门狗线程执行此操作).由于我们有时会遇到无法运行的问题,因此我们希望将其移至单独的进程.

                At the moment, our application is calling it in-process on an unhandled exception (we do it from a watchdog thread). Since we sometimes have problems with it not working, we'd like to move it to a separate process.

                现在,向另一个进程发出开始写入转储的信号是微不足道的(只需使用事件、信号量、你命名的)但是我如何传递我为回调函数获得的 LPEXCEPTION_POINTERS 信息我使用 SetUnhandledExceptionFilter 注册到另一个进程,以便它可以传递给 MiniDumpWriteDumpExceptionParam 参数??

                Now, signalling the other process to start writing the dump is trivial (just use an event, semaphore, you name it) but how do I pass the LPEXCEPTION_POINTERS info I get for the callback function I register with SetUnhandledExceptionFilter to the other process so that it can be passed to MiniDumpWriteDumps ExceptionParam argument??

                推荐答案

                您还需要 MINIDUMP_EXCEPTION_INFORMATION.ThreadId 值.最简单的方法,也是我让它工作的方式,是使用内存映射文件来传输 ThreadId 和 ExceptionPointers.以及唤醒看门狗的命名事件.指针在看门狗进程的上下文中无效并不重要.

                You also need the MINIDUMP_EXCEPTION_INFORMATION.ThreadId value. The simplest way, and the way I made it work, is to use a memory-mapped file to transfer both the ThreadId and the ExceptionPointers. And a named event to wake up the watchdog. It doesn't matter that the pointer is not valid in the context of the watchdog process.

                在监视进程中使用 CreateFileMapping + MapViewOfFile 作为其初始化的一部分,在看门狗中使用 OpenFileMapping + MapViewOfFile.然后您的 SetUnhandledExceptionFilter 应该只调用 GetCurrentThreadId() 并将 tid 和 pExcept 复制到内存映射文件视图,调用 SetEvent() 唤醒看门狗并永远阻塞,直到看门狗终止它.

                Use CreateFileMapping + MapViewOfFile in the watched process as part of its initialization, OpenFileMapping + MapViewOfFile in the watchdog. Your SetUnhandledExceptionFilter should then only call GetCurrentThreadId() and copy the tid and the pExcept to the memory mapped file view, call SetEvent() to wake up the watchdog and block forever until the watchdog terminates it.

                这篇关于在进程外使用 MiniDumpWriteDump 时如何获取异常信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:#error 请使用/MD 开关进行 _AFXDLL 构建 下一篇:如何找出 cl.exe 的内置宏

                相关文章

                最新文章

                <legend id='H1uA6'><style id='H1uA6'><dir id='H1uA6'><q id='H1uA6'></q></dir></style></legend>
                <i id='H1uA6'><tr id='H1uA6'><dt id='H1uA6'><q id='H1uA6'><span id='H1uA6'><b id='H1uA6'><form id='H1uA6'><ins id='H1uA6'></ins><ul id='H1uA6'></ul><sub id='H1uA6'></sub></form><legend id='H1uA6'></legend><bdo id='H1uA6'><pre id='H1uA6'><center id='H1uA6'></center></pre></bdo></b><th id='H1uA6'></th></span></q></dt></tr></i><div id='H1uA6'><tfoot id='H1uA6'></tfoot><dl id='H1uA6'><fieldset id='H1uA6'></fieldset></dl></div>

                <tfoot id='H1uA6'></tfoot>
                • <bdo id='H1uA6'></bdo><ul id='H1uA6'></ul>

                  <small id='H1uA6'></small><noframes id='H1uA6'>