コード例 #1
0
 public IList<PARAMETER> GetParamInfo()
 {
     ICorDebugILFrame ilFrame = frame as ICorDebugILFrame;
     IList<PARAMETER> args = null;
     if (ilFrame != null){
         ICorDebugValue value = null;
         ICorDebugValueEnum values = null;
         ilFrame.EnumerateArguments(out values);
         uint val = 0;
         values.GetCount(out val);
         if (val > 0) {
             args = new List<PARAMETER>();
         }
         for (uint index = 0; index < val; index++){
             try{
                 ilFrame.GetArgument(index, out value);
                 MDbgValue mdgbVal = new MDbgValue(new CorValue(value));
                 DEBUGPARAM param = new DEBUGPARAM();
                 param.name = mdgbVal.Name;
                 param.type = mdgbVal.TypeName;
                 param.isComplex = mdgbVal.IsComplexType;
                 param.isNull = mdgbVal.IsNull;
                 param.corValue = mdgbVal;
                 args.Add(param);
             } catch (COMException e){
                 if ((uint)e.ErrorCode == 0x80131304)
                 {
                     DEBUGPARAM degParam = new DEBUGPARAM();
                     degParam.corValue = null;
                     degParam.inValid = true;
                     //degParam.corType = CorElementType.;
                     args.Add(degParam);
                     //return null;
                 }
                 else
                 {
                     throw;
                 }
             }
         }
     }
     return args;
 }
コード例 #2
0
        public void GetPropertyValue(DEBUGPARAM property)
        {
            ICorDebugEval eVal = null;
            corThread.CreateEval(out eVal);
            uint pramsCount = 0;
            ICorDebugValue[] value = new ICorDebugValue[2];
            if (property.corValue != null)
            {
                //value[0] = property.corValue;
                pramsCount++;

                if (property.indexValue != null)
                {
                    ICorDebugValue newVal = null;
                    eVal.CreateValue(CorElementType.ELEMENT_TYPE_I4, null, out newVal);
                    ICorDebugGenericValue dGenricVal = newVal as ICorDebugGenericValue;
                    if (dGenricVal != null)
                    {
                        Byte bv = Convert.ToByte(property.indexValue);
                        unsafe
                        {
                            dGenricVal.SetValue(new IntPtr(&bv));
                        }
                    }
                    value[1] = newVal;
                    pramsCount++;
                }

            }
            //newVal.
            //value[0] = property.corValue;
            eVal.CallFunction(property.property.CorFun, pramsCount, value);

            //VARIABLE var = new VARIABLE();
            //var.
            //ICorDebugValue val = null;
            //eVal.GetResult(out val);
        }