Following on from this question I now have code that can attach to a process using the Mdbg API.
The problem is that I can't detach from the process if I need to. When I call
mgProcess.Detach().WaitOne(); ( where mgProcess is a MDbgProcess created from an MDbgEngine object ) I get the following error message:
Process not synchronized...
There is a great presentation by Dan Farino, Chief Systems Architect at MySpace.com, showcasing a web-based stack dump tool that catalogues all threads running in a given process (what they're doing, how long they've been executing, etc.)
Their techniques are also summarized on highscalability.com:
PerfCollector.
Centralized
collect...
How do you evaluate a static method that takes parameters using MDbg on the command-line?
To call Assembly.GetCallingAssembly(), this works:
mdbg> funceval System.Reflection.Assembly.GetCallingAssembly
How would you call the Assembly.Load method? eg. Assembly.Load("Foo.Bar")
...
I want to print out a list of all the different Types loaded in a running .NET process. My plan is to eventually build a GUI app based on this, so I want to do this from my code as opposed to a third party tool. I think my best bet is to use MDbgCore to attach to the running process, and then use MDbgProcess.AppDomains to get CorAppDomai...
I'd like to be able to debug .net code using Mdbg. Is there any way of getting it besides installing Visual Studio ( assuming this is a valid way of obtaining ) ?
...
Is there a .NET 4.0 version of the mdbg managed debugger source ?
I need to port my CPU analyzer, and ICorDebug has changed a bit in .NET 4.0.
...
In order to try out mdbg, I have the following simple hello world program:
// kkk.cs
using System;
class HelloMain
{
static public void Main()
{
Console.WriteLine("Hello");
}
}
Compile it with csc /debug kkk.cs, this yields:
kkk.exe
kkk.pdb
I then do (from the visual studio command line):
mdbg kkk.exe
or
...