- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
假设我的应用程序有两个线程 A 和 B,每个线程都抛出一个异常。我可以通过使用 ~{threadid}s
然后运行 !pe
来确定哪个线程引发了哪个异常吗?
最佳答案
通常只有一个线程抛出导致应用程序终止的异常。也就是说,我看到它发生在调试 session 期间,异常线程被卡住,其他线程被恢复。
.NET !threads
命令将列出 .NET 线程和每个线程上的异常:
0:000> !threads
ThreadCount: 6
UnstartedThread: 0
BackgroundThread: 2
PendingThread: 0
DeadThread: 0
Hosted Runtime: no
PreEmptive Lock
ID OSID ThreadOBJ State GC GC Alloc Context Domain Count APT Exception
0 1 251c 00000000003deff0 201a220 Enabled 00000000027846f8:0000000002785fd0 0000000000382ca0 0 MTA
2 2 2b10 0000000000a88280 b220 Enabled 0000000000000000:0000000000000000 0000000000382ca0 0 MTA (Finalizer)
3 3 255c 0000000000aacac0 b020 Enabled 00000000027862b8:0000000002787fd0 0000000000382ca0 0 MTA System.ArgumentException (0000000002786090)
4 4 2a48 0000000000aad5b0 b020 Enabled 000000000278a290:000000000278bfd0 0000000000382ca0 0 MTA System.NotImplementedException (000000000278a070)
5 5 2e50 0000000000aa20d0 b020 Enabled 0000000002788268:0000000002789fd0 0000000000382ca0 0 MTA System.OutOfMemoryException (0000000002788048)
6 6 d50 0000000000aa2e00 b020 Enabled 000000000278c280:000000000278dfd0 0000000000382ca0 0 MTA System.Threading.ThreadInterruptedException (000000000278c060)
然后您可以切换到列为 ID
的线程并将异常转储到该线程(~xs;!pe
或 ~xe!pe
其中 x 是 ID):
0:004> ~3e!pe
Exception object: 0000000002786090
Exception type: System.ArgumentException
Message: This method does not have arguments.
InnerException: <none>
StackTrace (generated):
SP IP Function
000000000112F100 000007FF0017055F MultiException!MultiException.Program.ThrowException1()+0x5f
000000000112F140 000007FEEB4E2BBC mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)+0x9c
000000000112F190 000007FEEB57AADE mscorlib_ni!System.Threading.ThreadHelper.ThreadStart()+0x4e
StackTraceString: <none>
HResult: 80070057
0:004> ~4e!pe
Exception object: 000000000278a070
Exception type: System.NotImplementedException
Message: This method does nothing but thorwing this exception.
InnerException: <none>
StackTrace (generated):
SP IP Function
000000000135F2C0 000007FF0017067F MultiException!MultiException.Program.ThrowException2()+0x5f
000000000135F300 000007FEEB4E2BBC mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)+0x9c
000000000135F350 000007FEEB57AADE mscorlib_ni!System.Threading.ThreadHelper.ThreadStart()+0x4e
StackTraceString: <none>
HResult: 80004001
同样重要的是要知道:.NET 在内存中预先分配了一些异常,以便稍后可以抛出它们。这可能会让初次使用 WinDbg 的开发人员感到困惑。所以不要担心,如果您在 !dumpheap -stat -type Exception
的输出中看到一些异常,例如在一个简单的 HelloWorld 应用程序中:
0:000> !dumpheap -stat -type Exception
total 7 objects
Statistics:
MT Count TotalSize Class Name
78e4421c 1 12 System.Text.DecoderExceptionFallback
78e441d8 1 12 System.Text.EncoderExceptionFallback
78e4108c 1 72 System.ExecutionEngineException
78e40ffc 1 72 System.StackOverflowException
78e40f6c 1 72 System.OutOfMemoryException
78e4111c 2 144 System.Threading.ThreadAbortException
Total 7 objects
在非托管代码中,抛出异常的线程在使用~
显示线程时用#
标记:
0:000> ~
. 0 Id: 2b14.251c Suspend: 1 Teb: 000007ff`fffde000 Unfrozen
1 Id: 2b14.71c Suspend: 1 Teb: 000007ff`fffdb000 Unfrozen
2 Id: 2b14.2b10 Suspend: 1 Teb: 000007ff`fffd9000 Unfrozen
# 3 Id: 2b14.255c Suspend: 1 Teb: 000007ff`fffd7000 Unfrozen
4 Id: 2b14.2a48 Suspend: 1 Teb: 000007ff`fffd5000 Unfrozen
5 Id: 2b14.2e50 Suspend: 1 Teb: 000007ff`fffd3000 Unfrozen
6 Id: 2b14.d50 Suspend: 1 Teb: 000007ff`fff0e000 Unfrozen
如果您看不到 #
,那么它通常隐藏在 .
后面。您可以使用 ~#s
切换到此线程。请注意,WinDbg 只显示一个 #
,尽管在其他线程上也有异常(exception)。我不知道如何在 native 方面解决这个问题。
关于c# - 确定从转储文件中抛出异常的线程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28904015/
我已经在标准 WPF 控件中实现了一个报告,并且还实现了一个 DocumentPaginator获取这些控件并将它们转换为用于打印的文档。 我还实现了一些使用文档分页器将页面呈现为图像并使用 PDFS
在 C# 中,我有以下代码: public static string GetHashCode(string p) { var a = new SHA256Managed();
您好,我正在尝试在编码后将我的 mysqli 数据库输出到一个 js 文件,我用 json_encode 对其进行编码没有任何问题,但是如何将其放入 js 文件中(每次更新时更新) mysqli数据已
我需要将 select 从 JS 传递到 HTML。 select 应该包含来自 PHP 的 option。 所以,首先我有一个 HTML div,我将在其中添加来自 JS 的内容。
我有一个相当大且复杂的 SVG 代码,它根据页面信息使用 JavaScript 和 jQuery 动态生成。 然后我有一个 AJAX 帖子保存。 我无法将其转换为正确发布图像数据? var canva
我想将我的本地日期 ([NSDate date]) 转换为 GMT 以创建一个 JSON 字符串 (/Date(1324435876019-0000)/)。 当我将时钟设置为 EST 时区时,我的代码
1. 原始单据与实体之间的关系 可以是一对1、一对多、多对多的关系。在一般情况下,它们是一对一的关系:即一张原始单据对应且只对应一个实体。在特殊情况下,它们可能是一对多或多对一的关系,即一张原
CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界. 这篇CFSDN的博客文章服务器五大相关基础知识【转】由作者收集整理,如果你对这篇文章有兴趣,记得
Google Apps 脚本 - Gmail 是否会实现 GmailMessage (GmailThread) .getAsPdf() 方法?预期输出与 Gmail 中可用的打印为 PDF 的输出相同
有一个需求是要在一个云监控的状态值中存储多个状态(包括可同时存在的各种异常、警告状态)使用了位运算机制在一个int型中存储。 现在监控日志数据量非常大(亿级别)需要对数据按每小时、每天进行聚合,供
CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界. 这篇CFSDN的博客文章1张图看懂RAID功能,6张图教会配置服务器【转】由作者收集整理,如果你
我正在使用 FFMPeg(版本 ffmpeg-20170330-ad7aff0-win64-static)将 RTSP 转换为 .m3u8。 命令是: ffmpeg -rtsp_transport t
我有一个 JTree使用 DefaultTreeModel 的对象作为模型,我添加/删除与该模型相关的节点。 此时,我需要在图形界面中显示树结构,例如 JPanel .如何映射 DefaultTree
我当前正在接收一个文件并将其存储到 NSString 中。然后,我从字符串中创建一个数组并将其呈现在 TableView 中。这在一定程度上有效。我目前收到的数据如下: 公司名称|帐户代码\r\n公司
我需要创建 NSImage cocoa 对象的 base64 字符串表示形式。处理这个问题的最佳方法是什么,苹果文档似乎在这个主题上有点短(或者我只是找不到它)。 Base64 编码从外面看起来相当复
JS 中的 .toISOString() 函数给我这样的字符串: 2015-06-14T20:00:00:000Z 我需要它是这样的: 2015-06-14T20:00:00Z JS 中是否有其他函数
我正在尝试使用 JavaScript 转换 COLORREF: COLORREF : When specifying an explicit RGB color, the COLORREF value
我在这里遇到了这个代码的问题,只是想制作一个小计算器: 打包申请; import javafx.event.ActionEvent; import javafx.scene.control.TextF
我想要做的是能够通过本地PC上的USS通过sshfs挂载主机上的一些文件。我可以做到这一点,但 sshfs 不能直接完成从 EBCDIC 到 ascii/unicode 的转换。有没有我可以设置的标志
我正在尝试在 python 中将一堆 Visio 文件转换为 pdf。我已经引用了这个.doc to pdf using python并编写了以下代码: import comtypes.client
我是一名优秀的程序员,十分优秀!