-
Notifications
You must be signed in to change notification settings - Fork 5k
[mono] Save trimmed methods list to a file #97705
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
[mono] Save trimmed methods list to a file #97705
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly looks ok, but I'm not sure the short method names are really what we want to put in the file.
Also, how will users discover these files?
@@ -247,6 +250,7 @@ private static string ComputeGuid(MetadataReader mr) | |||
int methodToken = MetadataTokens.GetToken(mr, mdefh); | |||
MethodDefinition mdef = mr.GetMethodDefinition(mdefh); | |||
int rva = mdef.RelativeVirtualAddress; | |||
string methodName = mr.GetString(mdef.Name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't the full name of the method (ie: NameSpace.ClassName+NestedClassName<T,U>.SomeMethod<V,W>(Arg1 arg1, Arg2 arg2, ..., ArgN argN)
). It's just SomeMethod
. Is that what we want? The file might have 100 methods all named ToString
or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. Do you know how to get the method full signature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's not an easy way :-(
you need to get the mdef.GetDeclaringType()
which will be a TypeDefinitionHandle
. then you need to get the TypeDefinition
using mr.GetTypeDefiniton()
which will have a Namespace
and a Name
property. And also you have to get its GetDeclaringType
if it's a nested type, and so on until there's no more enclosing types.
That will at least get you enough so you can print SomeNameSpace.SomeClass.SomeEnclosingType.SomeMethodName
which is better. (it woudl be good to also print the method signature in case we need to care about overloads, but that's harder)
Is there a way to get the full method signature?
This functionality is not useful for the user as they don't have control over what to trim and what not to trim. This is added to help mono developers to debug potential future issues. |
This should give the user a way to know which exact methods got trimmed.