-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementing the SOS -u command #34
Comments
Just for reference, if I create a full memory dump of the same process, load it into WinDbg and then run the SOS command
Here's the full output:
|
Sorry for the (long) delay in responding. Things tend to be very slow around here from the end of November to January 1st. I have been on vacation. IDebugControl doesn't know anything about CLR constructs. In fact, the implementation !u in SOS actually captures the output of IDebugControl::Disassemble, runs it through text processing, resolves references to managed code, and does inline text replacement. That's how SOS's !u works under-the-hood. If you want similar functionality you'll need to similarly parse the output of Disassemble and do the inline replacement yourself, mostly using ClrRuntime.GetMethodByAddress. As for Disassemble resolving Does that help at all? |
Thanks for the reply, it's very helpful. It turns out that I'm actually already parsing the output in the same way it that SOS !u (based on your description), so that's cool. Although I was creating a lookup of Also thanks for the tips about the symbol paths, for anyone else who finds this issue I'm currently using code like this, which seems to work: var symbols = dataTarget.DebuggerInterface as IDebugSymbols;
symbols.SetSymbolPath("http://msdl.microsoft.com/download/symbols");
var control = dataTarget.DebuggerInterface as IDebugControl;
control.Execute(DEBUG_OUTCTL.NOT_LOGGED, ".reload", DEBUG_EXECUTE.NOT_LOGGED); |
@mattwarren Is the disassembly code available? |
@ayende Unfortunately I never finished the disassembly code, but if you want a working version take a look at the excellent msos library from @goldshtn. It's built on-top of CLRMD and supports the |
I'm trying to use ClrMD to print out the assembly code of a method, as part of a Benchmarking library I'm working on
At the moment I use code similar to the Machine Code sample to get the memory address, then I use code like this to get the assembly code (where
debugControl
is of typeIDebugControl
from IDebugControl.cs):That works okay and I get an output like so, but the
call
instructions aren't resolved to a method name, they just have the memory address:However if I run the -u command in WinDbg, it's able to resolve the method name of the
call
instruction, even with JIT methods such asmscorwks!JIT_Throw
.Is there a way I can replicate this with ClrMD?
The text was updated successfully, but these errors were encountered: