从UWP应用检查转储文件 [英] Inspect dump files from UWP app

查看:170
本文介绍了从UWP应用检查转储文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我启用了在Windows 10移动电话上保存转储文件的功能:

First I enabled saving of dump files on a Windows 10 Mobile phone:


设置>更新并添加安全>对于开发人员>保存很多故障转储:3

Settings > Update & Security > For developers > Save this many crash dumps: 3

然后我调试了一个引发异常的应用程序。停止后,我继续调试。再次断开并连接手机后,我可以访问存储在 Windows phone\Phone\Documents\Debug 目录下的转储文件。该文件名为

Then I debugged an app which throwed an exception. I continued the debugging after stop. After disconnecting and connecting the mobile phone again, I was able to access the dump file stored under Windows phone\Phone\Documents\Debug directory. The file is called

FPCL.WIndows-a736c773-c105-4b30-a799-4bf317872f5e,2016年5月3日的异常C000027B 12.11.dmp

并具有约140 MB!

and has about 140 MB!

我将文件复制到了<我的UWP应用的code> bin 目录。之后,我将其作为文件在Visual Studio 2015中打开(在同一项目中)。现在,我可以看到 Dump摘要,并且具有以下按钮:

I copied the file to the bin directory of my UWP app. Afterwards I opened it as file in Visual Studio 2015 (in the same project). Now I can see the Dump Summary and I have the following buttons:


  • 仅使用托管调试

  • 使用混合调试

  • 仅使用本机调试

  • 设置符号路径

  • 全部复制到剪贴板

  • Debug with Managed Only
  • Debug with Mixed
  • Debug with Native Only
  • Set symbol paths
  • Copy all to clipboard

如果我运行 Debug with Only Managed 我得到


运行时捕获了一个致命异常。请参阅监视窗口中的$ stowedexception以查看原始异常信息。

A fatal exception was caught by the runtime. See $stowedexception in the Watch window to view the original exception information.

,然后单击 Break ,我得到了


没有兼容的代码在运行。所选的调试引擎不支持在当前线程上执行的任何代码(例如,仅执行本机运行时代码)。

No compatible code running. The selected debug engine does not support any code executing on the current thread (e.g. only native runtime code is executing).

Watch 1 窗口,我看到以下内容

In the Watch 1 window I see the following


名称:{CLR} $ stowedexception

值:{未实现该方法或操作。}

类型:System.NotImplementedException

Name: {CLR}$stowedexception
Value: {"The method or operation is not implemented."}
Type: System.NotImplementedException

是我在应用程序中抛出的异常。当我打开此节点并在 StackTrace 下查看时,我可以获得行号。在按 Continue 时,我得到

This should be the exception I have thrown in my app. When I open this node and look under StackTrace I can get a line number. On pressing Continue I get


调试器无法继续运行该进程。调试转储文件时不支持此操作。

The debugger cannot continue running the process. This operation is not supported when debugging dump files.

所以我只能停止它。

如果我运行使用混合调试,我会再次得到

If I run Debug with Mixed I get again


运行时捕获了致命异常。请参阅监视窗口中的$ stowedexception以查看原始异常信息。

A fatal exception was caught by the runtime. See $stowedexception in the Watch window to view the original exception information.

,然后单击 Break ,我得到了


kernelbase.pdb未加载
kernelbase.pdb包含查找模块KERNELBASE.dll的源所需的调试信息
模块信息:版本:10.0.10586.218(th2_release.160401-1800)原始位置:KERNELBASE.dll
请尝试以下选项之一:更改现有的PDB和二进制搜索路径,然后重试:Microsoft Symbol Servers

kernelbase.pdb not loaded kernelbase.pdb contains the debug information required to find the source for the module KERNELBASE.dll Module Information: Version: 10.0.10586.218 (th2_release.160401-1800) Original Location: KERNELBASE.dll Try one of the following options: Change existing PDB and binary search paths and retry: Microsoft Symbol Servers

在这里,我可以按 Load New 。因此,在给定位置下找不到kernelbase.pdb。应该存在吗?我应该在哪里找到它?

Here I can either press Load or New. So the kernelbase.pdb isn't found under the given location. Should it exists? Where should I find it?

Watch 1 窗口中,我看到的和上面一样,只能停止它。

In the Watch 1 window I see the same as above and I can only stop it.

如果我运行仅使用本机调试 ,我会得到

If I run Debug with Native Only I get


FPCL.WIndows中的0x76ECDF95(combase.dll)处未处理的异常-f736c883-f105-4d30-a719-4bf328872f5e,2016年5月3日异常C000027B 12.11.dmp:0xC000027B:Anwendungsinterne Ausnahme (参数:0x075C6838,0x00000002)。

Unhandled exception at 0x76ECDF95 (combase.dll) in FPCL.WIndows - f736c883-f105-4d30-a719-4bf328872f5e with exception C000027B on 5-03-2016 12.11.dmp: 0xC000027B: Anwendungsinterne Ausnahme (parameters: 0x075C6838, 0x00000002).

然后单击 Break ,我会得到与丢失的相同的kernelbase错误上面的内容,但在 Watch 1 窗口中,无法计算表达式。因此,我只能阻止它。

and on clicking Break I get the same missing kernelbase error as above, but here in the Watch 1 window the Value is Unable to evaluate the expression. So I can only stop it.

根据此发布,我应该能够检查源代码并找到原因。但是如何正确检查这种UWP转储文件?

According to this post I should be able to inspect the source code and find the cause. But how is such a UWP dump file inspected correctly?

推荐答案

您提到的


[...] 0xC000027B [...]

[...] 0xC000027B [...]

[...] $ stowedexception [...]

[...] $stowedexception [...]

都表明转储内部存在存储的异常。

which are both indicators that there is a Stowed Exception inside the dump.

要分析此类异常,请先观察第9频道碎片整理工具,第136集理查兹(Richards)进行解释,然后进行分析(位于 3:28 )。
然后从 Defrag下载PDE扩展名工具OnDrive 并在 >而不是Visual Studio。

To analyze such exceptions, first watch Channel 9 Defrag Tools, episode 136 where Andrew Richards explains and then analyzes them (at 3:28). Then download the PDE extension from the Defrag Tools OnDrive and analyze your dump in windbg instead of Visual Studio.

关于 kernelbase 的符号,应从Microsoft符号服务器上下载它们。要在WinDbg中进行设置,请使用 .symfix; .reload 。如果要在Visual Studio中进行其他尝试,请转到调试 /选项,然后选择调试 /符号,然后选中 Microsoft Symbol Servers。

Regarding the symbols of kernelbase, they should be downloaded from the Microsoft symbol server. To set that up in WinDbg, use .symfix;.reload. If you want to give it another try in Visual Studio, go to Debug / Options and choose Debugging / Symbols, then check "Microsoft Symbol Servers".

关于在Visual Studio中按一下按钮工作室,选择仅限托管在调试调试版本时,因为您的应用将在CoreCLR上运行并选择仅限本机,在调试发行版时,因为您的应用将使用.NET本机运行时支持。 (如果您没有更改默认设置,则适用;否则,请根据您的编译设置进行选择)

Regarding the button to press in Visual Studio, choose "Managed only" when debugging the debug build, because your app will run on CoreCLR and choose "Native Only" when debugging the release build, because your app will use .NET native runtime support. (This applies if you didn't change the default settings; otherwise choose according to your compilation settings)

这篇关于从UWP应用检查转储文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆