mdbg

Managed .NET debugger and async/await methods

╄→гoц情女王★ 提交于 2020-01-24 13:20:38
问题 I'm making a managed .NET debugger using MDBG sample. Consider some simple async example: 1: private async void OnClick(EventArgs args){ 2: var obj = new SomeClass(); 3: bool res = await StaticHelper.DoSomeAsyncStuff(); 4: if(res){ 5: Debug.WriteLine("result is True"); 6: } 7: else{ 8: Debug.WriteLine("result is False"); 9: } 10: someField = obj.Name + "is:" + res.ToString(); 11: } 12: public static async Task<bool> DoSomeAsyncStuff(){ 13: await Task.Delay(5000); 14: return true; 15: }

mdb's substitute for gdb's catch throw?

末鹿安然 提交于 2020-01-07 02:58:24
问题 I am not very much expert in gdb and mdb but What i know is that :- `(gdb) catch throw` This will interrupt anytime an exception is thrown Do i have any similar command in mdb which will interrupt anytime an exception is thrown? 回答1: No, this doesn't exist as such; that's because on Solaris, it depends on your compiler and/or compile options which C++ ABI is being used (and how exceptions are being thrown). mdb isn't making an attempt to know all of that, and neither is gdb on Solaris (if you

How to Invoke ICorDebug

蹲街弑〆低调 提交于 2019-12-25 18:34:12
问题 In "MDbg Sample.zip" projects, invoke the function from COM Module as: [ComImport, Guid("3D6F5F61-7538-11D3-8D5B-00104B35E7EF"), InterfaceType((short) 1)] public interface ICorDebug { ... } The question is where to find the Guid("3D6F5F61-7538-11D3-8D5B-00104B35E7EF"), i can not find it in the regedit, but how to connect the ICoreDebug interface with the COM module? 回答1: It's not in the registry. That guid is the IID, ICorDebug doesn't support remote access so there is no reason to register a

Can you see the evaluation stack in mdbg?

安稳与你 提交于 2019-12-22 18:36:31
问题 Say I have the following CIL: ldc.i4 40 <- a breakpoint is set here ldc.i4.2 add box int32 call void [mscorlib]System.Console::WriteLine(string) I then use ilasm /debug main.il to assemble the exe and pdb files to use in mdbg. My question is, when I'm at say line 3, before the add operation is executed, I would want to see the evaluation stack which would show me the two int32 constants, 40 and 2, which I had loaded before. How can I view this evaluation stack in mdbg? 回答1: I found the

Debugger StepInto auto-generated code and JMC issue

做~自己de王妃 提交于 2019-12-22 12:24:04
问题 I'm making a managed .NET debugger using MDBG sample. Currently I'm struggling with StepInto behavior, while StepOut and StepOver seems to work. To achieve Just-My-Code stepping I'm calling SetJMCStatus on modules load. That works fine and allow me to debug just my code. But since I'm setting entire module as JMC, some auto-generated code comes into play and ruin stepping-into. An example of such code could be auto-property. Since debugger is executing Il instructions, with step-into I'm

Can you see the evaluation stack in mdbg?

我们两清 提交于 2019-12-06 05:09:39
Say I have the following CIL: ldc.i4 40 <- a breakpoint is set here ldc.i4.2 add box int32 call void [mscorlib]System.Console::WriteLine(string) I then use ilasm /debug main.il to assemble the exe and pdb files to use in mdbg. My question is, when I'm at say line 3, before the add operation is executed, I would want to see the evaluation stack which would show me the two int32 constants, 40 and 2, which I had loaded before. How can I view this evaluation stack in mdbg? I found the command that's needed to view the evaluation stack while debugging in mdbg: p[rint] . p[rint] prints local or

Reading objects from memory with MDbgEng

元气小坏坏 提交于 2019-12-01 08:59:04
问题 I wanted to help out @mark in a question where he is asking for an API to dump many objects from a .NET crash dump file. So I wrote the following code using mdbgeng , but unfortunately it fails with a NotImplementedException when trying to enumerate the objects in memory. using System; using System.Runtime.InteropServices; using Microsoft.Samples.Debugging.CorDebug; using Microsoft.Samples.Debugging.CorDebug.Utility; using Microsoft.Samples.Debugging.MdbgEngine; using Microsoft.Samples