Author: jbevain
Date: 2007-04-25 18:57:02 -0400 (Wed, 25 Apr 2007)
New Revision: 76291

Modified:
   trunk/cecil/pdb/ChangeLog
   trunk/cecil/pdb/Mono.Cecil.Pdb/PdbWriter.cs
Log:
2007-02-21  Jb Evain  <[EMAIL PROTECTED]>

        * Start working on local var debug infos emitting.


Modified: trunk/cecil/pdb/ChangeLog
===================================================================
--- trunk/cecil/pdb/ChangeLog   2007-04-25 22:56:15 UTC (rev 76290)
+++ trunk/cecil/pdb/ChangeLog   2007-04-25 22:57:02 UTC (rev 76291)
@@ -1,3 +1,7 @@
+2007-02-21  Jb Evain  <[EMAIL PROTECTED]>
+
+       * Start working on local var debug infos emitting.
+
 2007-02-21  Jb Evain  <[EMAIL PROTECTED]>
 
        * Mono.Cecil.Pdb/PdbReader.cs

Modified: trunk/cecil/pdb/Mono.Cecil.Pdb/PdbWriter.cs
===================================================================
--- trunk/cecil/pdb/Mono.Cecil.Pdb/PdbWriter.cs 2007-04-25 22:56:15 UTC (rev 
76290)
+++ trunk/cecil/pdb/Mono.Cecil.Pdb/PdbWriter.cs 2007-04-25 22:57:02 UTC (rev 
76291)
@@ -50,15 +50,15 @@
                        m_pdb = pdb;
                }
 
-               public void Write (MethodBody body)
+               public void Write (MethodBody body, byte [][] variables)
                {
                        CreateDocuments (body);
                        m_writer.OpenMethod (new SymbolToken ((int) 
body.Method.MetadataToken.ToUInt ()));
-                       CreateScopes (body, body.Scopes);
+                       CreateScopes (body, body.Scopes, variables);
                        m_writer.CloseMethod ();
                }
 
-               void CreateScopes (MethodBody body, ScopeCollection scopes)
+               void CreateScopes (MethodBody body, ScopeCollection scopes, 
byte [][] variables)
                {
                        foreach (Scope s in scopes) {
                                int startOffset = s.Start.Offset;
@@ -104,23 +104,23 @@
                                m_writer.DefineSequencePoints (GetDocument 
(doc),
                                        offsets, startRows, startCols, endRows, 
endCols);
 
-                               //CreateLocalVariable (s, startOffset, 
endOffset);
+                               CreateLocalVariable (s, startOffset, endOffset, 
variables);
 
-                               CreateScopes (body, s.Scopes);
+                               CreateScopes (body, s.Scopes, variables);
                                m_writer.CloseNamespace ();
 
                                m_writer.CloseScope (endOffset);
                        }
                }
 
-               void CreateLocalVariable (IVariableDefinitionProvider provider, 
int startOffset, int endOffset)
+               void CreateLocalVariable (IVariableDefinitionProvider provider, 
int startOffset, int endOffset, byte [][] variables)
                {
                        for (int i = 0; i < provider.Variables.Count; i++) {
                                VariableDefinition var = provider.Variables [i];
                                m_writer.DefineLocalVariable (
                                        var.Name,
-                                       (System.Reflection.FieldAttributes) 
FieldAttributes.Private,
-                                       new byte [0], // need a way to get the 
a field signature
+                                       0,
+                                       variables [i],
                                        SymAddressKind.ILOffset,
                                        i,
                                        0,
@@ -142,6 +142,9 @@
 
                ISymbolDocumentWriter GetDocument (Document document)
                {
+                       if (document == null)
+                               return null;
+
                        ISymbolDocumentWriter docWriter = m_documents 
[document.Url] as ISymbolDocumentWriter;
                        if (docWriter != null)
                                return docWriter;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to