Merge pull request #601 from knocte/sock_improvements
[mono.git] / mcs / class / Mono.Debugger.Soft / Mono.Debugger.Soft / MethodMirror.cs
index 0b2ddaf5f61549f7e4ef67ca88a328807c051881..ac97cb02fb43742c806aedec74020c48f04d6e00 100644 (file)
@@ -77,11 +77,13 @@ namespace Mono.Debugger.Soft
                 * Creating the custom attributes themselves could modify the behavior of the
                 * debuggee, so we return objects similar to the CustomAttributeData objects
                 * used by the reflection-only functionality on .net.
+                * Since protocol version 2.21
                 */
                public CustomAttributeDataMirror[] GetCustomAttributes (bool inherit) {
                        return GetCAttrs (null, inherit);
                }
 
+               /* Since protocol version 2.21 */
                public CustomAttributeDataMirror[] GetCustomAttributes (TypeMirror attributeType, bool inherit) {
                        if (attributeType == null)
                                throw new ArgumentNullException ("attributeType");
@@ -89,12 +91,12 @@ namespace Mono.Debugger.Soft
                }
 
                CustomAttributeDataMirror[] GetCAttrs (TypeMirror type, bool inherit) {
-                       if (cattrs == null && Metadata != null && !Metadata.HasCustomAttributes)
+                       if (cattrs == null && meta != null && !Metadata.HasCustomAttributes)
                                cattrs = new CustomAttributeDataMirror [0];
 
                        // FIXME: Handle inherit
                        if (cattrs == null) {
-                               CattrInfo[] info = vm.conn.Type_GetCustomAttributes (id, 0, false);
+                               CattrInfo[] info = vm.conn.Method_GetCustomAttributes (id, 0, false);
                                cattrs = CustomAttributeDataMirror.Create (vm, info);
                        }
                        var res = new List<CustomAttributeDataMirror> ();
@@ -238,13 +240,13 @@ namespace Mono.Debugger.Soft
 
                public LocalVariable[] GetLocals () {
                        if (locals == null) {
-
                                LocalsInfo li = new LocalsInfo ();
                                try {
                                        li = vm.conn.Method_GetLocalsInfo (id);
                                } catch (CommandException) {
-                                       throw new ArgumentException ("Method doesn't have a body.");
+                                       throw new AbsentInformationException ();
                                }
+
                                // Add the arguments as well
                                var pi = vm.conn.Method_GetParamInfo (id);