diff options
author | Therzok <teromario@yahoo.com> | 2013-11-05 22:48:57 +0400 |
---|---|---|
committer | Therzok <teromario@yahoo.com> | 2013-11-05 23:04:01 +0400 |
commit | 051e904cc5e17ebf84885789231f200f7cf62dca (patch) | |
tree | 21cb86f6e7e1e4b5f2fa493e2bcf7985dbc1f359 /main/src | |
parent | 3922fd55055c4b65b97eeeb817ab54da545ce4e2 (diff) |
[CorDebug] Fix property reading issues.
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/Metadata/MetadataPropertyInfo.cs | 34 | ||||
-rw-r--r-- | main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/Metadata/MetadataType.cs | 4 |
2 files changed, 26 insertions, 12 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/Metadata/MetadataPropertyInfo.cs b/main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/Metadata/MetadataPropertyInfo.cs index d3e60c789e..5a41d0d7df 100644 --- a/main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/Metadata/MetadataPropertyInfo.cs +++ b/main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/Metadata/MetadataPropertyInfo.cs @@ -83,6 +83,12 @@ namespace Microsoft.Samples.Debugging.CorMetadata m_propAttributes = (PropertyAttributes) pdwPropFlags;
m_name = szProperty.ToString ();
MetadataHelperFunctions.GetCustomAttribute (importer, propertyToken, typeof (System.Diagnostics.DebuggerBrowsableAttribute));
+
+ if (!m_importer.IsValidToken ((uint)m_pmdGetter))
+ m_pmdGetter = 0;
+
+ if (!m_importer.IsValidToken ((uint)m_pmdSetter))
+ m_pmdSetter = 0;
}
public override PropertyAttributes Attributes
@@ -107,11 +113,15 @@ namespace Microsoft.Samples.Debugging.CorMetadata public override MethodInfo GetGetMethod (bool nonPublic)
{
- if (m_getter == null) {
- if (m_pmdGetter != 0)
- m_getter = new MetadataMethodInfo (m_importer, m_pmdGetter);
- }
- return m_getter;
+ if (m_pmdGetter == 0)
+ return null;
+
+ if (m_getter == null)
+ m_getter = new MetadataMethodInfo (m_importer, m_pmdGetter);
+
+ if (nonPublic || m_getter.IsPublic)
+ return m_getter;
+ return null;
}
public override ParameterInfo[] GetIndexParameters ( )
@@ -124,11 +134,15 @@ namespace Microsoft.Samples.Debugging.CorMetadata public override MethodInfo GetSetMethod (bool nonPublic)
{
- if (m_setter == null) {
- if (m_pmdSetter != 0)
- m_setter = new MetadataMethodInfo (m_importer, m_pmdSetter);
- }
- return m_setter;
+ if (m_pmdSetter == 0)
+ return null;
+
+ if (m_setter == null)
+ m_setter = new MetadataMethodInfo (m_importer, m_pmdSetter);
+
+ if (nonPublic || m_setter.IsPublic)
+ return m_setter;
+ return null;
}
public override object GetValue (object obj, BindingFlags invokeAttr, Binder binder, object[] index, System.Globalization.CultureInfo culture)
diff --git a/main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/Metadata/MetadataType.cs b/main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/Metadata/MetadataType.cs index d1aad08753..a476aa77fd 100644 --- a/main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/Metadata/MetadataType.cs +++ b/main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/Metadata/MetadataType.cs @@ -423,9 +423,9 @@ namespace Microsoft.Samples.Debugging.CorMetadata break;
MetadataPropertyInfo prop = new MetadataPropertyInfo (m_importer, methodToken, this);
try {
- MethodInfo mi = prop.GetGetMethod ();
+ MethodInfo mi = prop.GetGetMethod () ?? prop.GetSetMethod ();
if (mi == null)
- mi = prop.GetSetMethod ();
+ continue;
if (FlagsMatch (mi.IsPublic, mi.IsStatic, bindingAttr))
al.Add (prop);
}
|