国产片侵犯亲女视频播放_亚洲精品二区_在线免费国产视频_欧美精品一区二区三区在线_少妇久久久_在线观看av不卡

服務器之家:專注于服務器技術及軟件下載分享
分類導航

PHP教程|ASP.NET教程|Java教程|ASP教程|編程技術|正則表達式|C/C++|IOS|C#|Swift|Android|VB|R語言|JavaScript|易語言|vb.net|

服務器之家 - 編程語言 - ASP.NET教程 - 如何把 .NET 進程中的所有托管異常找出來?

如何把 .NET 進程中的所有托管異常找出來?

2021-10-26 22:04一線碼農聊技術Tess ASP.NET教程

大家應該知道 .NET異常 本質上就是一個 Object 對象,也就是說只要你執行了 new XXException() 語句,那么它就會分配到 GC Heap 上。

如何把 .NET 進程中的所有托管異常找出來?

大家應該知道 .NET異常 本質上就是一個 Object 對象,也就是說只要你執行了 new XXException() 語句,那么它就會分配到 GC Heap 上。

這也就意味著,如果你有一個進程的dump文件,那你就可以從dump中導出程序最近都拋了什么異常,換句話說只要這些異常沒有被 GC 回收,你都可以給它找出來。

實現起來很簡單,只要在 windbg 中輸入如下命令即可。

  1. 0:015>!dumpheap-typeException
  2. ------------------------------
  3. Heap0
  4. AddressMTSize
  5. 02ea6b0c79330a8072
  6. 02ea75f07930eab476
  7. 06f57aa47930eab476
  8. 06f5829c7930eab476
  9. 06f58a947930eab476
  10. 06f5928c7930eab476
  11. 06f59a847930eab476
  12. 06f5a27c7930eab476
  13. 06f5aa747930eab476
  14. 06f5b26c7930eab476
  15. 06f5ba647930eab476
  16. 06f5c25c7930eab476
  17. 06f5ca547930eab476
  18. 06f5d24c7930eab476
  19. total319objects
  20. ------------------------------
  21. total656objects
  22. Statistics:
  23. MTCountTotalSizeClassName
  24. 79333dc0112System.Text.DecoderExceptionFallback
  25. 79333d7c112System.Text.EncoderExceptionFallback
  26. 793172f8264System.UnhandledExceptionEventHandler
  27. 79330c30172System.ExecutionEngineException
  28. 79330ba0172System.StackOverflowException
  29. 79330b10172System.OutOfMemoryException
  30. 79330a80172System.Exception
  31. 79330cc02144System.Threading.ThreadAbortException
  32. 7930eab464649096System.IO.DirectoryNotFoundException
  33. Total656objects

如果你想看某一個具體異常的詳細信息,可以使用命令 !pe 02ea6b0c 。

  1. !pe02ea6b0c
  2. Exceptionobject:02ea6b0c
  3. Exceptiontype:System.Exception
  4. Message:Theemailenteredisnotavalidemailaddress
  5. InnerException:
  6. StackTrace(generated):
  7. SPIPFunction
  8. 024AF2C80FE3125EApp_Code_da2s7oyo!BuggyMail.IsValidEmailAddress(System.String)+0x76
  9. 024AF2E80FE31192App_Code_da2s7oyo!BuggyMail.SendEmail(System.String,System.String)+0x4a
  10. StackTraceString:
  11. HResult:80131500
  12. Therearenestedexceptionsonthisthread.Runwith-nestedfordetails

那現在問題來了,我想看所有異常的詳細信息怎么辦呢?人肉一個一個的用 !pe 命令去執行,那將會多惡心。。。所以友好的方式就是寫腳本去提速,這里我使用 .foreach 命令。

  1. .foreach(ex{!dumpheap-typeException-short}){.echo"********************************";!pe${ex}}

上面我用了一個 -short 參數,目的就是只輸出 address 地址方便腳本遍歷,然后將迭代項送入 !pe ,輸出結果如下:

  1. 0:015>.foreach(ex{!dumpheap-typeException-short}){.echo"********************************";!pe${ex}}
  2. ********************************
  3. Exceptionobject:02ea6b0c
  4. Exceptiontype:System.Exception
  5. Message:Theemailenteredisnotavalidemailaddress
  6. InnerException:
  7. StackTrace(generated):
  8. SPIPFunction
  9. 024AF2C80FE3125EApp_Code_da2s7oyo!BuggyMail.IsValidEmailAddress(System.String)+0x76
  10. 024AF2E80FE31192App_Code_da2s7oyo!BuggyMail.SendEmail(System.String,System.String)+0x4a
  11. StackTraceString:
  12. HResult:80131500
  13. Therearenestedexceptionsonthisthread.Runwith-nestedfordetails
  14. ********************************
  15. Exceptionobject:02ea75f0
  16. Exceptiontype:System.IO.DirectoryNotFoundException
  17. Message:Couldnotfindapartofthepath'c:\idontexist\log.txt'.
  18. InnerException:
  19. StackTrace(generated):
  20. SPIPFunction
  21. 024AF044792741F2mscorlib_ni!System.IO.__Error.WinIOError(Int32,System.String)+0xc2
  22. 024AF0A0792EB22Bmscorlib_ni!System.IO.FileStream.Init(System.String,System.IO.FileMode,System.IO.FileAccess,Int32,Boolean,System.IO.FileShare,Int32,System.IO.FileOptions,SECURITY_ATTRIBUTES,System.String,Boolean)+0x48b
  23. 024AF198792EA882mscorlib_ni!System.IO.FileStream..ctor(System.String,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,Int32,System.IO.FileOptions)+0x42
  24. 024AF1C07927783Fmscorlib_ni!System.IO.StreamWriter.CreateFile(System.String,Boolean)+0x3f
  25. 024AF1D4792777DBmscorlib_ni!System.IO.StreamWriter..ctor(System.String,Boolean,System.Text.Encoding,Int32)+0x3b
  26. 024AF1F4797EE19Fmscorlib_ni!System.IO.StreamWriter..ctor(System.String)+0x1f
  27. 024AF2040FE31325App_Code_da2s7oyo!Utility.WriteToLog(System.String,System.String)+0x5d
  28. StackTraceString:
  29. HResult:80070003
  30. Therearenestedexceptionsonthisthread.Runwith-nestedfordetails
  31. ********************************
  32. Exceptionobject:02ea7de8
  33. Exceptiontype:System.IO.DirectoryNotFoundException
  34. Message:Couldnotfindapartofthepath'c:\idontexist\log.txt'.
  35. InnerException:
  36. StackTrace(generated):
  37. SPIPFunction
  38. 024AEF60792741F2mscorlib_ni!System.IO.__Error.WinIOError(Int32,System.String)+0xc2
  39. 024AEFBC792EB22Bmscorlib_ni!System.IO.FileStream.Init(System.String,System.IO.FileMode,System.IO.FileAccess,Int32,Boolean,System.IO.FileShare,Int32,System.IO.FileOptions,SECURITY_ATTRIBUTES,System.String,Boolean)+0x48b
  40. 024AF0B4792EA882mscorlib_ni!System.IO.FileStream..ctor(System.String,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,Int32,System.IO.FileOptions)+0x42
  41. 024AF0DC7927783Fmscorlib_ni!System.IO.StreamWriter.CreateFile(System.String,Boolean)+0x3f
  42. 024AF0F0792777DBmscorlib_ni!System.IO.StreamWriter..ctor(System.String,Boolean,System.Text.Encoding,Int32)+0x3b
  43. 024AF110797EE19Fmscorlib_ni!System.IO.StreamWriter..ctor(System.String)+0x1f
  44. 024AF1200FE31325App_Code_da2s7oyo!Utility.WriteToLog(System.String,System.String)+0x5d
  45. StackTraceString:
  46. HResult:80070003
  47. Therearenestedexceptionsonthisthread.Runwith-nestedfordetails

當然你也可以打印出當前異常的內部異常,配上一個 -nest 參數即可。

  1. .foreach(ex{!dumpheap-typeException-short}){.echo"********************************";!pe–nested${ex}}

原文鏈接:https://mp.weixin.qq.com/s/LhxU7Nr8n9bAx1sXKSlT4g

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 精品国产不卡一区二区三区 | 天堂中文资源在线 | 日韩欧美国产一区二区 | 91网站免费 | 亚洲午夜精品 | 国产精品美女久久久久久久久久久 | 日韩欧美在线综合网 | 亚洲午夜精品 | 毛片91| 欧美另类视频在线 | av免费观看网站 | 亚州av在线 | 久久妇女高潮片免费观看 | 三a视频 | 在线观看国产一区二区 | 欧美精品一区二区三区中文字幕 | 亚洲精品电影在线观看 | 久久一级| 国产毛片久久久久 | 国产乱码久久久久久一区二区 | 视频1区 | 岛国a视频 | а天堂中文最新一区二区三区 | 亚洲在线视频 | 欧美日韩美女 | 亚洲精品视频网站在线观看 | 久久高清精品 | 日韩成人在线网站 | 中文字幕不卡在线观看 | 日韩免费视频 | 日日摸夜夜添夜夜添精品视频 | 欧美成人精品高清视频在线观看 | 亚洲精品乱码8久久久久久日本 | 欧美性猛交xxxx黑人猛交 | 一区二区三区视频免费在线观看 | 国产一区二区免费 | 91精品一久久香蕉国产线看观看新通道出现 | 成人欧美一区二区三区在线播放 | 91最新视频| 亚洲午夜免费视频 | 一区三区在线观看 |