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
Getting the method name of a Delegate instance #35
Comments
|
I agree there should be a method in ClrMD to do the dirty work for you. I'll add that to the todo list. Also, your last line of code you should be able to replace with this: As for it not working on all instances...sometimes _methodPtrAux is set and it means something slightly different (I think it's the MethodDesc itself but that's based on my fuzzy memory). If you handle that case then you should be able to handle all delegate types. In any case I agree this should be part of ClrMD itself so I'll try to get to it next time I have a chance to work on ClrMD (probably a big effort the last week of December). |
FYI this table from the CoreCLR source explains the difference usages of |
|
Is this still supposed to work? Because at the moment I can not make it work. In the dump (x86) I have this: |
|
It seems to work for me if I do it that way, For x86: It's works for instance (methodPtr) and for static method (methodPtrAux). Still need to check for all types @mattwarren posted above Update |
|
Looking back at this issue, it's a borderline case of whether I want to add something to ClrMD to answer this question directly. I try to keep ClrMD as the raw building blocks to implement what you need. In this case I think it's possible to correctly get the function from a delegate, but it looks like it's really complicated due to the implementation. When it's that fiddly to get right, that's a case where we should consider adding something to ClrMD to support it. I'm leaving the issue open for now. |
|
I'm going to close this issue. I'm in the process of streamlining ClrMD and I don't think this will make the cut since there's example code to do this. |
It's difficult to find the corresponding method of a Delegate instance while debugging with clrmd, sos have the same limitation.
This blog explained how to do it with windbg + sos:
http://geekswithblogs.net/akraus1/archive/2012/05/20/149699.aspx
I translated that to ClrMD and it work with instance delegate (I think it won't work with static methods).
This is very hacky and does not work with all Delegate instance, do you think a proper implementation should be implemented in ClrMD?
The text was updated successfully, but these errors were encountered: