How to use ADPLUS to _ONLY_ get MiniDumpOnSecond

泪湿孤枕 提交于 2019-12-02 10:08:09

I played with the configuration file that can be attached with the -c flag...since i'm mostly interested in catching errors in my custom COM components, these settings create minidumps without fulldumps, and ignore CLR crashes, and don't full-dump on IISReset.

To have this run all the time, create a scheduled task. From an admin prompt:

schtasks /create /tn "Crash Dump Monitor w3wp" /tr "\"C:\Program Files\Debugging Tools for Windows (x86)\adplus.exe\" -c \"C:\Program Files\Debugging Tools for Windows (x86)\adplus_w3wp.xml\"" /sc ONSTART

Save this file as C:\Program Files\Debugging Tools for Windows (x86)\adplus_w3wp.xml :

<ADPlus Version="2">
<!-- 
PURPOSE:      Capture mini crash dumps in IIS 6.0. Do not capture full dumps
INSTRUCTIONS: Save this file in the same location as adplus.exe (usually C:\Program Files\Debugging Tools for Windows (x86))
COMMAND LINE: 
          "C:\Program Files\Debugging Tools for Windows (x86)\adplus.exe" -iis -c "C:\Program Files\Debugging Tools for Windows (x86)\adplus_w3wp.xml"
-->
  <Settings>
    <RunMode>Crash</RunMode>
    <OutputDir>C:\Dumps</OutputDir>
    <ProcessToMonitor>w3wp.exe</ProcessToMonitor>
  </Settings>
  <Exceptions>
    <All>
      <Actions1>VOID</Actions1>
      <Actions2>VOID</Actions2>
      <ReturnAction1>GN</ReturnAction1>
      <ReturnAction2>GN</ReturnAction2>
    </All>
    <Exception Code="av"><!-- Access Violoation -->
      <Actions1>Log;Time;Stack;MiniDump;EventLog</Actions1>
      <ReturnAction1>GN</ReturnAction1>
      <Actions2>Log;Time;Stack;MiniDump;EventLog</Actions2>
      <ReturnAction2>GN</ReturnAction2>
    </Exception>
    <Exception Code="ch"><!-- InvalidHandle -->
      <Actions1>Log;Time;Stack;MiniDump;EventLog</Actions1>
      <ReturnAction1>GN</ReturnAction1>
      <Actions2>Log;Time;Stack;MiniDump;EventLog</Actions2>
      <ReturnAction2>GN</ReturnAction2>
    </Exception>
    <Exception Code="ii"><!-- Illegal Instruction -->
      <Actions1>Log;Time;Stack;MiniDump;EventLog</Actions1>
      <ReturnAction1>GN</ReturnAction1>
      <Actions2>Log;Time;Stack;MiniDump;EventLog</Actions2>
      <ReturnAction2>GN</ReturnAction2>
    </Exception>
    <Exception Code="dz"><!-- IntegerDivide -->
      <Actions1>VOID</Actions1>
      <Actions2>Log;Time;Stack;MiniDump;EventLog</Actions2>
      <ReturnAction1>GN</ReturnAction1>
      <ReturnAction2>GN</ReturnAction2>
    </Exception>
    <Exception Code="c000008e"><!-- FloatingDivide -->
      <Actions1>VOID</Actions1>
      <Actions2>Log;Time;Stack;MiniDump;EventLog</Actions2>
      <ReturnAction1>GN</ReturnAction1>
      <ReturnAction2>GN</ReturnAction2>
    </Exception>
    <Exception Code="iov"><!-- IntegerOverflow -->
      <Actions1>VOID</Actions1>
      <Actions2>Log;Time;Stack;MiniDump;EventLog</Actions2>
      <ReturnAction1>GN</ReturnAction1>
      <ReturnAction2>GN</ReturnAction2>
    </Exception>
    <Exception Code="lsq"><!-- InvalidLockSequence -->
      <Actions1>VOID</Actions1>
      <Actions2>Log;Time;Stack;MiniDump;EventLog</Actions2>
      <ReturnAction1>GN</ReturnAction1>
      <ReturnAction2>GN</ReturnAction2>
    </Exception>
    <Exception Code="sov"><!-- StackOverflow -->
      <Actions1>VOID</Actions1>
      <Actions2>Log;Time;Stack;MiniDump;EventLog</Actions2>
      <ReturnAction1>GN</ReturnAction1>
      <ReturnAction2>GN</ReturnAction2>
    </Exception>
    <Exception Code="aph"><!-- Application_hang -->
      <Actions1>VOID</Actions1>
      <Actions2>Log;Time;Stack;MiniDump;EventLog</Actions2>
      <ReturnAction1>GN</ReturnAction1>
      <ReturnAction2>GN</ReturnAction2>
    </Exception>
    <Exception Code="dm"><!-- Data_misaligned -->
      <Actions1>VOID</Actions1>
      <Actions2>Log;Time;Stack;MiniDump;EventLog</Actions2>
      <ReturnAction1>GN</ReturnAction1>
      <ReturnAction2>GN</ReturnAction2>
    </Exception>
    <Exception Code="gp"><!-- Guard_page_violation -->
      <Actions1>VOID</Actions1>
      <Actions2>Log;Time;Stack;MiniDump;EventLog</Actions2>
      <ReturnAction1>GN</ReturnAction1>
      <ReturnAction2>GN</ReturnAction2>
    </Exception>
    <Exception Code="ip"><!-- In_page_IO_error -->
      <Actions1>VOID</Actions1>
      <Actions2>Log;Time;Stack;MiniDump;EventLog</Actions2>
      <ReturnAction1>GN</ReturnAction1>
      <ReturnAction2>GN</ReturnAction2>
    </Exception>
    <Exception Code="isc"><!-- Invalid_system_call -->
      <Actions1>VOID</Actions1>
      <Actions2>Log;Time;Stack;MiniDump;EventLog</Actions2>
      <ReturnAction1>GN</ReturnAction1>
      <ReturnAction2>GN</ReturnAction2>
    </Exception>
    <Exception Code="sbo"><!-- StackOverflow -->
      <Actions1>VOID</Actions1>
      <Actions2>Log;Time;Stack;MiniDump;EventLog</Actions2>
      <ReturnAction1>GN</ReturnAction1>
      <ReturnAction2>GN</ReturnAction2>
    </Exception>
    <Exception Code="epr"><!-- Process_Shut_Down -->
      <Actions1>Log;Time;</Actions1>
      <ReturnAction1>Q</ReturnAction1>
    </Exception>
    <!--
    <Exception Code="clr">
      <Actions1>VOID</Actions1>
      <Actions2>Log;Time;Stack;MiniDump;EventLog</Actions2>
      <ReturnAction1>GN</ReturnAction1>
      <ReturnAction2>GN</ReturnAction2>
    </Exception>

    <Exception Code="*">
      <Actions1>VOID</Actions1>
      <Actions2>Log;Time;Stack;MiniDump;EventLog</Actions2>
      <ReturnAction1>GN</ReturnAction1>
      <ReturnAction2>GN</ReturnAction2>
    </Exception>

    <Exception Code="clr">
      <Actions1>VOID</Actions1>
      <Actions2>Log;Time;Stack;MiniDump;EventLog</Actions2>
      <ReturnAction1>GN</ReturnAction1>
      <ReturnAction2>GN</ReturnAction2>
    </Exception>-->

  </Exceptions>

</ADPlus>

Can anyone improve on this? Have I missed any important crashing exceptions?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!