Example #1
0
        public override ProcedureBase_v1 SignatureFromName(string fnName)
        {
            StructField_v1 field = null;

            try
            {
                var gcc = new GccMangledNameParser(fnName, this.PointerType.Size);
                field = gcc.Parse();
            }
            catch (Exception ex)
            {
                Debug.Print("*** Error parsing {0}. {1}", fnName, ex.Message);
                return(null);
            }
            if (field == null)
            {
                return(null);
            }
            if (field.Type is SerializedSignature sproc)
            {
                return(new Procedure_v1
                {
                    Name = field.Name,
                    Signature = sproc,
                });
            }
            return(null);
        }
Example #2
0
        public override ExternalProcedure SignatureFromName(string fnName)
        {
            StructField_v1 field = null;

            try
            {
                var gcc = new GccMangledNameParser(fnName, this.PointerType.Size);
                field = gcc.Parse();
            }
            catch (Exception ex)
            {
                Debug.Print("*** Error parsing {0}. {1}", fnName, ex.Message);
                return(null);
            }
            if (field == null)
            {
                return(null);
            }
            var sproc = field.Type as SerializedSignature;

            if (sproc != null)
            {
                var loader = new TypeLibraryDeserializer(this, false, Metadata);
                var sser   = this.CreateProcedureSerializer(loader, sproc.Convention);
                var sig    = sser.Deserialize(sproc, this.Architecture.CreateFrame()); //$BUGBUG: catch dupes?
                return(new ExternalProcedure(field.Name, sig)
                {
                    EnclosingType = sproc.EnclosingType
                });
            }
            return(null);
        }
Example #3
0
 public override ExternalProcedure SignatureFromName(string fnName)
 {
     StructField_v1 field = null;
     try
     {
         var gcc = new GccMangledNameParser(fnName, this.PointerType.Size);
         field = gcc.Parse();
     }
     catch (Exception ex)
     {
         Debug.Print("*** Error parsing {0}. {1}", fnName, ex.Message);
         return null;
     }
     if (field == null)
         return null;
     var sproc = field.Type as SerializedSignature;
     if (sproc != null)
     {
         var loader = new TypeLibraryDeserializer(this, false, Metadata);
         var sser = this.CreateProcedureSerializer(loader, sproc.Convention);
         var sig = sser.Deserialize(sproc, this.Architecture.CreateFrame());    //$BUGBUG: catch dupes?
         return new ExternalProcedure(field.Name, sig)
         {
             EnclosingType = sproc.EnclosingType
         };
     }
     return null;
 }