2011年1月6日

摘要: 源程序如下:using System; using System.Text; using System.Runtime.InteropServices;namespace Advanced.NET.Debugging.Chapter5 { class Pinning { static void Main(string[] args) { Pinning p = new Pinning(); p.Run(); } public void Run() { SByte[] b1 = null; SByte[] b2 = null; SByte[] b3 = null; Con 阅读全文
posted @ 2011-01-06 22:58 李志鹏 阅读(233) 评论(0) 推荐(0)
摘要: 代码如下: using System; using System.Text; using System.Runtime.InteropServices; namespace Advanced.NET.Debugging.Chapter5 {      class LOH     {         static void Main(string[] args)         {         ... 阅读全文
posted @ 2011-01-06 22:35 李志鹏 阅读(197) 评论(0) 推荐(0)
摘要: 程序如下: using System; using System.Text; using System.Runtime.InteropServices; namespace Advanced.NET.Debugging.Chapter5 {     class NativeEvent     {         private IntPtr nativeHandle;         public... 阅读全文
posted @ 2011-01-06 00:28 李志鹏 阅读(192) 评论(0) 推荐(0)

2011年1月4日

摘要: 源代码如下:using System; using System.Text; using System.Threading;namespace Advanced.NET.Debugging.Chapter5 { class Name { private string first; private string last; public string First { get { return first; } } public string Last { get { return last; } } public Name(string f, string l) { first = 阅读全文
posted @ 2011-01-04 22:46 李志鹏 阅读(208) 评论(0) 推荐(0)

2010年12月31日

摘要: 代码如下: using System; using System.Text; using System.Runtime.Remoting; namespace Advanced.NET.Debugging.Chapter5 {     class Name     {         private string first;         private string last;       ... 阅读全文
posted @ 2010-12-31 00:53 李志鹏 阅读(221) 评论(0) 推荐(0)

2010年12月30日

摘要: 程序如下: using System; using System.Text; using System.Runtime.Remoting; namespace Advanced.NET.Debugging.Chapter5 {     class Name     {         private string first;         private string last;       ... 阅读全文
posted @ 2010-12-30 21:33 李志鹏 阅读(226) 评论(0) 推荐(0)

2010年12月29日

摘要: 程序在执行RunInDedicated()方法时会失败,原因在于执行h.Unwrap()时需要读取EntityUtil定义的程序集,但是CreateDomain()方法创建domain的时候指定的ApplicationBase为C:\\Windows\\system32。 1. 在WinDbg里载入AppDomain.exe. 2. 揿2执行RunInDedicated()方法时,出错。 3.... 阅读全文
posted @ 2010-12-29 23:19 李志鹏 阅读(279) 评论(0) 推荐(0)

2010年12月27日

摘要: 将程序的04assembly.dll改为04assembly.old,这个时候程序将找不到该dll。 1. 在WinDbg里载入04TypeCast.exe 2. 执行 sxe 0xe0434f4d 3. 执行 g 4. 在程序发生异常停下来之后,执行 .loadby sos.dll mscorwks 5. 执行 kb ,打印出托管和非托管的call stack的内容。 6. 可见,在... 阅读全文
posted @ 2010-12-27 23:00 李志鹏 阅读(222) 评论(0) 推荐(0)

2010年12月26日

摘要: 03simple.exe的源代码如下: 在执行到ReadKey()的时候,Ctrl+C,执行!clrstack -a以后得到如下的结果: 分析如下: 1. Clr的Stack里出来的方法的顺序和源程序是反的,因而应该从下往上看。 2. !clrstack 紧紧列出调用的方法,!clrstack –l 还附带列出本地的变量的指针, !clrstack –p 还附带列出参数,而-a是-p和-l的效... 阅读全文
posted @ 2010-12-26 22:01 李志鹏 阅读(235) 评论(0) 推荐(0)
摘要: 针对的程序为03ObjTypes.cs,其部分代码如下,试图让程序在断点处,得到其中ObjTypes中的coordinate对象,intArray对象,strArray对象和本地的point对象的具体值。 1. 在WinDbg下载入03ObjTypes.exe。 2. 连续执行两次 g, 到程序要求按任意键继续处。 3. 执行 Ctrl + C。 4. 执行 .loadby sos.dll ... 阅读全文
posted @ 2010-12-26 19:33 李志鹏 阅读(245) 评论(0) 推荐(0)

导航