Hi I just wanted to get the sequence points for the method Invoke in class 
SyncInvoker an internal class found in  System.ServiceModel.Dispatcher 
namespace which is under System.ServiceModel dll.

This is what I did

                AssemblyDefinition assembly = 
AssemblyDefinition.ReadAssembly(@"C:\Program Files (x86)\Reference 
Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.ServiceModel.dll");
                List<SequencePoint> seqPointsIns = new 
List<SequencePoint>();
                
                //Gets all types of the MainModule of the assembly
                foreach(TypeDefinition type in assembly.MainModule.Types)
                {
                    if (type.Name == "SyncMethodInvoker")
                    {
                        foreach (MethodDefinition method in type.Methods)
                        {
                            if (method.Name == "Invoke")
                            {
                                var il = method.Body.GetILProcessor();
                                foreach (var item in il.Body.Instructions)
                                {
                                    if (item.SequencePoint != null)
                                    {
                                        
seqPointsIns.Add(item.SequencePoint);
                                    }
                                }
                            }
                        }
                    }
                }

As you can see I try get sequence points. Here the il.Body.Instructions is 
0. What is wrong and how can it be rectified.?

-Jasper

-- 
-- 
--
mono-cecil
--- 
You received this message because you are subscribed to the Google Groups 
"mono-cecil" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to