Author: toshok
Date: 2005-04-12 01:18:54 -0400 (Tue, 12 Apr 2005)
New Revision: 42818

Modified:
   trunk/debugger/ChangeLog
   trunk/debugger/backends/Debugger.cs
   trunk/debugger/backends/mono/MonoLanguageBackend.cs
   trunk/debugger/backends/mono/MonoSymbolFile.cs
Log:
2005-04-11  Chris Toshok  <[EMAIL PROTECTED]>

        * backends/Debugger.cs (DebuggerBackend.LoadLibrary): if the
        library we're loading is a managed assembly, call
        mono_language.FindImage on it.

        * backends/mono/MonoLanguageBackend.cs
        (MonoLanguageBackend.get_DebuggerBackend): nuke.
        (MonoLanguageBackend.get_SourceFileFactory): new property.
        (MonoLanguageBackend.FindImage): new function.  actually cause the
        assembly to be loaded by the inferior.
        
        * backends/mono/MonoSymbolFile.cs (MonoMethod.Load): pass the
        SourceFileFactory to MonoMethodSource..ctor instead of the
        DebuggerBackend, since the SourceFileFactory is all that's used
        anyway.
        (MonoMethod.get_DeclaringType): don't return null, return
        decl_type.
        (MonoMethodSource..ctor): take SourceFileFactory instead of
        DebuggerBackend.



Modified: trunk/debugger/ChangeLog
===================================================================
--- trunk/debugger/ChangeLog    2005-04-12 03:39:23 UTC (rev 42817)
+++ trunk/debugger/ChangeLog    2005-04-12 05:18:54 UTC (rev 42818)
@@ -1,5 +1,26 @@
 2005-04-11  Chris Toshok  <[EMAIL PROTECTED]>
 
+       * backends/Debugger.cs (DebuggerBackend.LoadLibrary): if the
+       library we're loading is a managed assembly, call
+       mono_language.FindImage on it.
+
+       * backends/mono/MonoLanguageBackend.cs
+       (MonoLanguageBackend.get_DebuggerBackend): nuke.
+       (MonoLanguageBackend.get_SourceFileFactory): new property.
+       (MonoLanguageBackend.FindImage): new function.  actually cause the
+       assembly to be loaded by the inferior.
+       
+       * backends/mono/MonoSymbolFile.cs (MonoMethod.Load): pass the
+       SourceFileFactory to MonoMethodSource..ctor instead of the
+       DebuggerBackend, since the SourceFileFactory is all that's used
+       anyway.
+       (MonoMethod.get_DeclaringType): don't return null, return
+       decl_type.
+       (MonoMethodSource..ctor): take SourceFileFactory instead of
+       DebuggerBackend.
+
+2005-04-11  Chris Toshok  <[EMAIL PROTECTED]>
+
        * frontend/Command.cs (EventHandleCommand): split out this
        behavior from BreakpointEnableCommand, since it really annoys me
        to have BreakpointDisableCommand subclassing from

Modified: trunk/debugger/backends/Debugger.cs
===================================================================
--- trunk/debugger/backends/Debugger.cs 2005-04-12 03:39:23 UTC (rev 42817)
+++ trunk/debugger/backends/Debugger.cs 2005-04-12 05:18:54 UTC (rev 42818)
@@ -226,7 +226,7 @@
                                                "Cannot load .NET assembly {0} 
while " +
                                                "debugging an unmanaged 
application",
                                                filename);
-                               // mono_language.FindImage (process, filename);
+                               mono_language.FindImage (process, ass);
                        } else
                                bfd_container.AddFile (process, filename, true, 
false, false);
                }

Modified: trunk/debugger/backends/mono/MonoLanguageBackend.cs
===================================================================
--- trunk/debugger/backends/mono/MonoLanguageBackend.cs 2005-04-12 03:39:23 UTC 
(rev 42817)
+++ trunk/debugger/backends/mono/MonoLanguageBackend.cs 2005-04-12 05:18:54 UTC 
(rev 42818)
@@ -253,10 +253,21 @@
                        get { return heap; }
                }
 
-               public DebuggerBackend DebuggerBackend {
-                       get { return backend; }
+               public SourceFileFactory SourceFileFactory {
+                       get { return backend.SourceFileFactory; }
                }
 
+               internal void FindImage (Process process, R.Assembly ass)
+               {
+                       MonoSymbolFile file = (MonoSymbolFile) assembly_hash 
[ass];
+                       if (file != null)
+                               return;
+
+                       mutex.Lock ();
+                       process.CallMethod (info.LookupAssembly, ass.Location);
+                       mutex.Unlock ();
+               }
+
                public MonoType LookupMonoType (Type type)
                {
                        MonoSymbolFile file = (MonoSymbolFile) assembly_hash 
[type.Assembly];

Modified: trunk/debugger/backends/mono/MonoSymbolFile.cs
===================================================================
--- trunk/debugger/backends/mono/MonoSymbolFile.cs      2005-04-12 03:39:23 UTC 
(rev 42817)
+++ trunk/debugger/backends/mono/MonoSymbolFile.cs      2005-04-12 05:18:54 UTC 
(rev 42818)
@@ -201,10 +201,10 @@
                internal readonly ITargetMemoryInfo TargetInfo;
                internal readonly MonoLanguageBackend MonoLanguage;
                protected readonly DebuggerBackend backend;
-               readonly MonoSymbolTable symtab;
-               readonly string name;
-               readonly int address_size;
-               readonly int int_size;
+               MonoSymbolTable symtab;
+               string name;
+               int address_size;
+               int int_size;
 
                Hashtable range_hash;
                ArrayList ranges;
@@ -611,7 +611,7 @@
                                if (!address.WrapperAddress.IsNull)
                                        SetWrapperAddress 
(address.WrapperAddress);
 
-                               SetSource (new MonoMethodSource (file, this, 
info, method, address.LineNumbers));
+                               SetSource (new MonoMethodSource 
(file.MonoLanguage.SourceFileFactory, this, info, method, address.LineNumbers));
                        }
 
                        void get_variables ()
@@ -694,7 +694,7 @@
                                                throw new 
InvalidOperationException ();
 
                                        get_variables ();
-                                       return null;
+                                       return decl_type;
                                }
                        }
 
@@ -854,7 +854,6 @@
                protected class MonoMethodSource : MethodSource
                {
                        int start_row, end_row;
-                       MonoSymbolFile file;
                        JitLineNumberEntry[] line_numbers;
                        C.MethodEntry method;
                        SourceMethod source_method;
@@ -862,19 +861,18 @@
                        SourceFileFactory factory;
                        Hashtable namespaces;
 
-                       public MonoMethodSource (MonoSymbolFile file, IMethod 
imethod,
+                       public MonoMethodSource (SourceFileFactory factory, 
IMethod imethod,
                                                 SourceMethod source_method, 
C.MethodEntry method,
                                                 JitLineNumberEntry[] 
line_numbers)
                                : base (imethod, source_method.SourceFile)
                        {
-                               this.file = file;
+                               this.factory = factory;
                                this.imethod = imethod;
                                this.method = method;
                                this.line_numbers = line_numbers;
                                this.source_method = source_method;
                                this.start_row = method.StartRow;
                                this.end_row = method.EndRow;
-                               this.factory = 
file.MonoLanguage.DebuggerBackend.SourceFileFactory;
                        }
 
                        void generate_line_number (ArrayList lines, 
TargetAddress address, int offset,

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

Reply via email to