使用 WinDbg 和 ADPlus 7.0 帮助捕获 AV

发布于 2024-09-04 04:11:55 字数 1826 浏览 7 评论 0原文

我想捕获 SQL Server Compact Edition 中的内存访问冲突,如下所述 http://debuggingblog .com/wp/2009/02/18/memory-access-violation-in-sql-server-compact-editionce/ 建议的配置是:

<ADPlus>
   <Settings>
     <RunMode>CRASH</RunMode>
     <Option>Quiet</Option>
     <ProcessName>MyApp.exe</ProcessName>
   </Settings>
   <Exceptions>
     <Option>NoDumpOnFirstChance</Option>
     <Config>
       <Code>clr;av</Code><!–to get the full dump on clr access violation–>
       <Actions1>FullDump</Actions1>
       <ReturnAction1>gn</ReturnAction1>
     </Config>
   </Exceptions>
</ADPlus>

我下载最新的调试工具并观察 Microsoft 将 adplus 工具重写为托管代码并更改配置文件的语法。 我像这样重写配置文件:

 <ADPlus  Version="2">
 <Settings>
  <RunMode>Crash</RunMode>
  <Option>Quiet</Option>
  <Option>NoDumpOnFirst</Option>
  <Sympath>c:\symbols\</Sympath>
  <OutputDir>c:\work\output\</OutputDir>
  <ProcessName>c:\work\app\output\MyApp.exe</ProcessName>
 </Settings> 

 <Exceptions><!--to get the full dump on clr access violation-->
  <Exception Code="clr;av">   
   <Actions1>FullDump</Actions1>
   <ReturnAction1>gn</ReturnAction1>
  </Exception>  
 </Exceptions>
</ADPlus>

并且收到错误“无法通过代码找到异常:clr;av”。如果我理解正确,它没有加载 sos 扩展,但我找不到应该用来加载它的正确部分和语法。

adplus_old.vbs - 由于某些原因没有在 Windows 7 上启动进程。 WinDBG 6.12.0002.633 X86 ADPlus 引擎版本:7.01.002 02/27/2009

也许有人有一个使用最新的 adplus.exe 调试 .NET 应用程序的配置示例?

I want to catch Memory Access Violation in SQL Server Compact Edition like this described at
http://debuggingblog.com/wp/2009/02/18/memory-access-violation-in-sql-server-compact-editionce/
The suggested config is:

<ADPlus>
   <Settings>
     <RunMode>CRASH</RunMode>
     <Option>Quiet</Option>
     <ProcessName>MyApp.exe</ProcessName>
   </Settings>
   <Exceptions>
     <Option>NoDumpOnFirstChance</Option>
     <Config>
       <Code>clr;av</Code><!–to get the full dump on clr access violation–>
       <Actions1>FullDump</Actions1>
       <ReturnAction1>gn</ReturnAction1>
     </Config>
   </Exceptions>
</ADPlus>

I download latest Debugging Tools and observe what Microsoft rewrite adplus tool into managed code and change syntax of config File.
I rewrite config file like this:

 <ADPlus  Version="2">
 <Settings>
  <RunMode>Crash</RunMode>
  <Option>Quiet</Option>
  <Option>NoDumpOnFirst</Option>
  <Sympath>c:\symbols\</Sympath>
  <OutputDir>c:\work\output\</OutputDir>
  <ProcessName>c:\work\app\output\MyApp.exe</ProcessName>
 </Settings> 

 <Exceptions><!--to get the full dump on clr access violation-->
  <Exception Code="clr;av">   
   <Actions1>FullDump</Actions1>
   <ReturnAction1>gn</ReturnAction1>
  </Exception>  
 </Exceptions>
</ADPlus>

And I get error "Couldn't find exception with code: clr;av". If I understand right It didn't load sos extension, but I can't find the right section and syntax that I should use to load it.

adplus_old.vbs - for some reasons didn't launch process on Windows 7.
WinDBG 6.12.0002.633 X86
ADPlus Engine Version: 7.01.002 02/27/2009

Maybe someone has a working example of config of debugging .NET app with latest adplus.exe?

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

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

发布评论

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

评论(2

绅刃 2024-09-11 04:11:55

这应该为您加载 SOS.dll(如果您使用的是框架 v1,则为 .load clr10\sos.dll):

 <ADPlus  Version="2"> 
 <precommands>
    <cmd>.loadby sos mscorwks</cmd>
 </precommands>

 <Settings> 
  <RunMode>Crash</RunMode> 
  <Option>Quiet</Option> 
  <Option>NoDumpOnFirst</Option> 
  <Sympath>c:\symbols\</Sympath> 
  <OutputDir>c:\work\output\</OutputDir> 
  <ProcessName>c:\work\app\output\MyApp.exe</ProcessName> 
 </Settings>  

 <Exceptions><!--to get the full dump on clr access violation--> 
  <Exception Code="clr;av">    
   <Actions1>FullDump</Actions1> 
   <ReturnAction1>gn</ReturnAction1> 
  </Exception>   
 </Exceptions> 
</ADPlus> 

This should load SOS.dll for you (if you are using framework v1, the is <cmd>.load clr10\sos.dll</cmd>):

 <ADPlus  Version="2"> 
 <precommands>
    <cmd>.loadby sos mscorwks</cmd>
 </precommands>

 <Settings> 
  <RunMode>Crash</RunMode> 
  <Option>Quiet</Option> 
  <Option>NoDumpOnFirst</Option> 
  <Sympath>c:\symbols\</Sympath> 
  <OutputDir>c:\work\output\</OutputDir> 
  <ProcessName>c:\work\app\output\MyApp.exe</ProcessName> 
 </Settings>  

 <Exceptions><!--to get the full dump on clr access violation--> 
  <Exception Code="clr;av">    
   <Actions1>FullDump</Actions1> 
   <ReturnAction1>gn</ReturnAction1> 
  </Exception>   
 </Exceptions> 
</ADPlus> 
静若繁花 2024-09-11 04:11:55

根据ADPlus的文档:异常代码应该是错误代码的十六进制值。例如,如果您想捕获 AV - 您需要 0xC0000005

这是 关于捕获 CLR 错误转储的链接

According to this documentation for ADPlus: exception code should be hex value of error code. For instance, if you want to capture AV - you need 0xC0000005

Here is the link about capturing error dumps for CLR

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