Browse Source

Debugger now supports debugging IronPython code.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@4153 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 16 years ago
parent
commit
7a40b62660
  1. 5
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Debugger.Core.csproj
  2. 12
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Module.cs
  3. 11
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Internal/ManagedCallback.cs
  4. 1
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Interop/CorDebug/ICorDebugEditAndContinueSnapshot.cs
  5. 25
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Interop/CorDebug/ISequentialStream.cs
  6. 43
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Interop/CorDebug/IStream.cs
  7. 21
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Interop/CorDebug/_LARGE_INTEGER.cs
  8. 21
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Interop/CorDebug/_ULARGE_INTEGER.cs
  9. 33
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Interop/CorDebug/tagSTATSTG.cs
  10. 11
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Wrappers/CorDebug/Autogenerated/ISequentialStream.cs
  11. 28
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Wrappers/CorDebug/Autogenerated/IStream.cs
  12. 4
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Wrappers/CorSym/Autogenerated/ISymUnmanagedBinder.cs
  13. 10
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Wrappers/MetaData/MetaDataImport.cs

5
src/AddIns/Misc/Debugger/Debugger.Core/Project/Debugger.Core.csproj

@ -184,15 +184,10 @@
<Compile Include="Src\Interop\CorDebug\ICorDebugValue2.cs" /> <Compile Include="Src\Interop\CorDebug\ICorDebugValue2.cs" />
<Compile Include="Src\Interop\CorDebug\ICorDebugValueBreakpoint.cs" /> <Compile Include="Src\Interop\CorDebug\ICorDebugValueBreakpoint.cs" />
<Compile Include="Src\Interop\CorDebug\ICorDebugValueEnum.cs" /> <Compile Include="Src\Interop\CorDebug\ICorDebugValueEnum.cs" />
<Compile Include="Src\Interop\CorDebug\ISequentialStream.cs" />
<Compile Include="Src\Interop\CorDebug\IStream.cs" />
<Compile Include="Src\Interop\CorDebug\tagSTATSTG.cs" />
<Compile Include="Src\Interop\CorDebug\_COR_IL_MAP.cs" /> <Compile Include="Src\Interop\CorDebug\_COR_IL_MAP.cs" />
<Compile Include="Src\Interop\CorDebug\_COR_VERSION.cs" /> <Compile Include="Src\Interop\CorDebug\_COR_VERSION.cs" />
<Compile Include="Src\Interop\CorDebug\_FILETIME.cs" /> <Compile Include="Src\Interop\CorDebug\_FILETIME.cs" />
<Compile Include="Src\Interop\CorDebug\_LARGE_INTEGER.cs" />
<Compile Include="Src\Interop\CorDebug\_SECURITY_ATTRIBUTES.cs" /> <Compile Include="Src\Interop\CorDebug\_SECURITY_ATTRIBUTES.cs" />
<Compile Include="Src\Interop\CorDebug\_ULARGE_INTEGER.cs" />
<Compile Include="Src\Interop\CorSym\CorSymAddrKind.cs" /> <Compile Include="Src\Interop\CorSym\CorSymAddrKind.cs" />
<Compile Include="Src\Interop\CorSym\CorSymBinder_deprecated.cs" /> <Compile Include="Src\Interop\CorSym\CorSymBinder_deprecated.cs" />
<Compile Include="Src\Interop\CorSym\CorSymBinder_deprecatedClass.cs" /> <Compile Include="Src\Interop\CorSym\CorSymBinder_deprecatedClass.cs" />

12
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Module.cs

@ -190,6 +190,18 @@ namespace Debugger
} }
} }
public void UpdateSymbolsFromStream(Debugger.Wrappers.CorDebug.IStream pSymbolStream)
{
if (symReader != null) {
symReader.As<ISymUnmanagedDispose>().Destroy();
}
symReader = metaData.GetSymReader(pSymbolStream);
if (symReader != null) {
OnSymbolsLoaded(new ModuleEventArgs(this));
}
}
/// <summary> Sets all code as being 'my code'. The code will be gradually /// <summary> Sets all code as being 'my code'. The code will be gradually
/// set to not-user-code as encountered acording to stepping options </summary> /// set to not-user-code as encountered acording to stepping options </summary>
public void ResetJustMyCodeStatus() public void ResetJustMyCodeStatus()

11
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Internal/ManagedCallback.cs

@ -290,7 +290,16 @@ namespace Debugger
public void UpdateModuleSymbols(ICorDebugAppDomain pAppDomain, ICorDebugModule pModule, IStream pSymbolStream) public void UpdateModuleSymbols(ICorDebugAppDomain pAppDomain, ICorDebugModule pModule, IStream pSymbolStream)
{ {
EnterCallback(PausedReason.Other, "UpdateModuleSymbols", pAppDomain); EnterCallback(PausedReason.Other, "UpdateModuleSymbols", pAppDomain);
foreach (Module module in process.Modules) {
if (module.CorModule == pModule) {
process.TraceMessage("UpdateModuleSymbols: Found module: " + pModule.Name);
module.UpdateSymbolsFromStream(pSymbolStream);
process.Debugger.SetBreakpointsInModule(module);
break;
}
}
ExitCallback(); ExitCallback();
} }

1
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Interop/CorDebug/ICorDebugEditAndContinueSnapshot.cs

@ -12,6 +12,7 @@ namespace Debugger.Interop.CorDebug
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using Debugger.Interop.CorSym;
[ComImport, Guid("6DC3FA01-D7CB-11D2-8A95-0080C792E5D8"), InterfaceType((short) 1)] [ComImport, Guid("6DC3FA01-D7CB-11D2-8A95-0080C792E5D8"), InterfaceType((short) 1)]
public interface ICorDebugEditAndContinueSnapshot public interface ICorDebugEditAndContinueSnapshot

25
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Interop/CorDebug/ISequentialStream.cs

@ -1,25 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
// <version>$Revision$</version>
// </file>
#pragma warning disable 108, 1591
namespace Debugger.Interop.CorDebug
{
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[ComImport, Guid("0C733A30-2A1C-11CE-ADE5-00AA0044773D"), InterfaceType((short) 1)]
public interface ISequentialStream
{
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
void RemoteRead(out byte pv, [In] uint cb, out uint pcbRead);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
void RemoteWrite([In] ref byte pv, [In] uint cb, out uint pcbWritten);
}
}
#pragma warning restore 108, 1591

43
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Interop/CorDebug/IStream.cs

@ -1,43 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
// <version>$Revision$</version>
// </file>
#pragma warning disable 108, 1591
namespace Debugger.Interop.CorDebug
{
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[ComImport, InterfaceType((short) 1), Guid("0000000C-0000-0000-C000-000000000046")]
public interface IStream : ISequentialStream
{
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
void RemoteRead(out byte pv, [In] uint cb, out uint pcbRead);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
void RemoteWrite([In] ref byte pv, [In] uint cb, out uint pcbWritten);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
void RemoteSeek([In] _LARGE_INTEGER dlibMove, [In] uint dwOrigin, out _ULARGE_INTEGER plibNewPosition);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
void SetSize([In] _ULARGE_INTEGER libNewSize);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
void RemoteCopyTo([In, MarshalAs(UnmanagedType.Interface)] IStream pstm, [In] _ULARGE_INTEGER cb, out _ULARGE_INTEGER pcbRead, out _ULARGE_INTEGER pcbWritten);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
void Commit([In] uint grfCommitFlags);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
void Revert();
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
void LockRegion([In] _ULARGE_INTEGER libOffset, [In] _ULARGE_INTEGER cb, [In] uint dwLockType);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
void UnlockRegion([In] _ULARGE_INTEGER libOffset, [In] _ULARGE_INTEGER cb, [In] uint dwLockType);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
void Stat(out tagSTATSTG pstatstg, [In] uint grfStatFlag);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
void Clone([MarshalAs(UnmanagedType.Interface)] out IStream ppstm);
}
}
#pragma warning restore 108, 1591

21
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Interop/CorDebug/_LARGE_INTEGER.cs

@ -1,21 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
// <version>$Revision$</version>
// </file>
#pragma warning disable 108, 1591
namespace Debugger.Interop.CorDebug
{
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack=8)]
public struct _LARGE_INTEGER
{
public long QuadPart;
}
}
#pragma warning restore 108, 1591

21
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Interop/CorDebug/_ULARGE_INTEGER.cs

@ -1,21 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
// <version>$Revision$</version>
// </file>
#pragma warning disable 108, 1591
namespace Debugger.Interop.CorDebug
{
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack=8)]
public struct _ULARGE_INTEGER
{
public ulong QuadPart;
}
}
#pragma warning restore 108, 1591

33
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Interop/CorDebug/tagSTATSTG.cs

@ -1,33 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
// <version>$Revision$</version>
// </file>
#pragma warning disable 108, 1591
namespace Debugger.Interop.CorDebug
{
using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack=8)]
public struct tagSTATSTG
{
[MarshalAs(UnmanagedType.LPWStr)]
public string pwcsName;
public uint type;
public _ULARGE_INTEGER cbSize;
public _FILETIME mtime;
public _FILETIME ctime;
public _FILETIME atime;
public uint grfMode;
public uint grfLocksSupported;
public Guid clsid;
public uint grfStateBits;
public uint reserved;
}
}
#pragma warning restore 108, 1591

11
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Wrappers/CorDebug/Autogenerated/ISequentialStream.cs

@ -1,4 +1,4 @@
// <file> // <file>
// <copyright see="prj:///doc/copyright.txt"/> // <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/> // <license see="prj:///doc/license.txt"/>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/> // <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
@ -16,10 +16,9 @@ namespace Debugger.Wrappers.CorDebug
public partial class ISequentialStream public partial class ISequentialStream
{ {
private Debugger.Interop.CorSym.ISequentialStream wrappedObject;
private Debugger.Interop.CorDebug.ISequentialStream wrappedObject; internal Debugger.Interop.CorSym.ISequentialStream WrappedObject
internal Debugger.Interop.CorDebug.ISequentialStream WrappedObject
{ {
get get
{ {
@ -27,13 +26,13 @@ namespace Debugger.Wrappers.CorDebug
} }
} }
public ISequentialStream(Debugger.Interop.CorDebug.ISequentialStream wrappedObject) public ISequentialStream(Debugger.Interop.CorSym.ISequentialStream wrappedObject)
{ {
this.wrappedObject = wrappedObject; this.wrappedObject = wrappedObject;
ResourceManager.TrackCOMObject(wrappedObject, typeof(ISequentialStream)); ResourceManager.TrackCOMObject(wrappedObject, typeof(ISequentialStream));
} }
public static ISequentialStream Wrap(Debugger.Interop.CorDebug.ISequentialStream objectToWrap) public static ISequentialStream Wrap(Debugger.Interop.CorSym.ISequentialStream objectToWrap)
{ {
if ((objectToWrap != null)) if ((objectToWrap != null))
{ {

28
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Wrappers/CorDebug/Autogenerated/IStream.cs

@ -1,4 +1,4 @@
// <file> // <file>
// <copyright see="prj:///doc/copyright.txt"/> // <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/> // <license see="prj:///doc/license.txt"/>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/> // <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
@ -17,9 +17,9 @@ namespace Debugger.Wrappers.CorDebug
public partial class IStream public partial class IStream
{ {
private Debugger.Interop.CorDebug.IStream wrappedObject; private Debugger.Interop.CorSym.IStream wrappedObject;
internal Debugger.Interop.CorDebug.IStream WrappedObject internal Debugger.Interop.CorSym.IStream WrappedObject
{ {
get get
{ {
@ -27,13 +27,13 @@ namespace Debugger.Wrappers.CorDebug
} }
} }
public IStream(Debugger.Interop.CorDebug.IStream wrappedObject) public IStream(Debugger.Interop.CorSym.IStream wrappedObject)
{ {
this.wrappedObject = wrappedObject; this.wrappedObject = wrappedObject;
ResourceManager.TrackCOMObject(wrappedObject, typeof(IStream)); ResourceManager.TrackCOMObject(wrappedObject, typeof(IStream));
} }
public static IStream Wrap(Debugger.Interop.CorDebug.IStream objectToWrap) public static IStream Wrap(Debugger.Interop.CorSym.IStream objectToWrap)
{ {
if ((objectToWrap != null)) if ((objectToWrap != null))
{ {
@ -109,21 +109,21 @@ namespace Debugger.Wrappers.CorDebug
return pcbWritten; return pcbWritten;
} }
public Debugger.Interop.CorDebug._ULARGE_INTEGER RemoteSeek(Debugger.Interop.CorDebug._LARGE_INTEGER dlibMove, uint dwOrigin) public Debugger.Interop.CorSym._ULARGE_INTEGER RemoteSeek(Debugger.Interop.CorSym._LARGE_INTEGER dlibMove, uint dwOrigin)
{ {
Debugger.Interop.CorDebug._ULARGE_INTEGER plibNewPosition; Debugger.Interop.CorSym._ULARGE_INTEGER plibNewPosition;
this.WrappedObject.RemoteSeek(dlibMove, dwOrigin, out plibNewPosition); this.WrappedObject.RemoteSeek(dlibMove, dwOrigin, out plibNewPosition);
return plibNewPosition; return plibNewPosition;
} }
public void SetSize(Debugger.Interop.CorDebug._ULARGE_INTEGER libNewSize) public void SetSize(Debugger.Interop.CorSym._ULARGE_INTEGER libNewSize)
{ {
this.WrappedObject.SetSize(libNewSize); this.WrappedObject.SetSize(libNewSize);
} }
public Debugger.Interop.CorDebug._ULARGE_INTEGER RemoteCopyTo(IStream pstm, Debugger.Interop.CorDebug._ULARGE_INTEGER cb, out Debugger.Interop.CorDebug._ULARGE_INTEGER pcbRead) public Debugger.Interop.CorSym._ULARGE_INTEGER RemoteCopyTo(IStream pstm, Debugger.Interop.CorSym._ULARGE_INTEGER cb, out Debugger.Interop.CorSym._ULARGE_INTEGER pcbRead)
{ {
Debugger.Interop.CorDebug._ULARGE_INTEGER pcbWritten; Debugger.Interop.CorSym._ULARGE_INTEGER pcbWritten;
this.WrappedObject.RemoteCopyTo(pstm.WrappedObject, cb, out pcbRead, out pcbWritten); this.WrappedObject.RemoteCopyTo(pstm.WrappedObject, cb, out pcbRead, out pcbWritten);
return pcbWritten; return pcbWritten;
} }
@ -138,17 +138,17 @@ namespace Debugger.Wrappers.CorDebug
this.WrappedObject.Revert(); this.WrappedObject.Revert();
} }
public void LockRegion(Debugger.Interop.CorDebug._ULARGE_INTEGER libOffset, Debugger.Interop.CorDebug._ULARGE_INTEGER cb, uint dwLockType) public void LockRegion(Debugger.Interop.CorSym._ULARGE_INTEGER libOffset, Debugger.Interop.CorSym._ULARGE_INTEGER cb, uint dwLockType)
{ {
this.WrappedObject.LockRegion(libOffset, cb, dwLockType); this.WrappedObject.LockRegion(libOffset, cb, dwLockType);
} }
public void UnlockRegion(Debugger.Interop.CorDebug._ULARGE_INTEGER libOffset, Debugger.Interop.CorDebug._ULARGE_INTEGER cb, uint dwLockType) public void UnlockRegion(Debugger.Interop.CorSym._ULARGE_INTEGER libOffset, Debugger.Interop.CorSym._ULARGE_INTEGER cb, uint dwLockType)
{ {
this.WrappedObject.UnlockRegion(libOffset, cb, dwLockType); this.WrappedObject.UnlockRegion(libOffset, cb, dwLockType);
} }
public void Stat(out Debugger.Interop.CorDebug.tagSTATSTG pstatstg, uint grfStatFlag) public void Stat(out Debugger.Interop.CorSym.tagSTATSTG pstatstg, uint grfStatFlag)
{ {
this.WrappedObject.Stat(out pstatstg, grfStatFlag); this.WrappedObject.Stat(out pstatstg, grfStatFlag);
} }
@ -156,7 +156,7 @@ namespace Debugger.Wrappers.CorDebug
public IStream Clone() public IStream Clone()
{ {
IStream ppstm; IStream ppstm;
Debugger.Interop.CorDebug.IStream out_ppstm; Debugger.Interop.CorSym.IStream out_ppstm;
this.WrappedObject.Clone(out out_ppstm); this.WrappedObject.Clone(out out_ppstm);
ppstm = IStream.Wrap(out_ppstm); ppstm = IStream.Wrap(out_ppstm);
return ppstm; return ppstm;

4
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Wrappers/CorSym/Autogenerated/ISymUnmanagedBinder.cs

@ -1,4 +1,4 @@
// <file> // <file>
// <copyright see="prj:///doc/copyright.txt"/> // <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/> // <license see="prj:///doc/license.txt"/>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/> // <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
@ -100,7 +100,7 @@ namespace Debugger.Wrappers.CorSym
return ISymUnmanagedReader.Wrap(this.WrappedObject.GetReaderForFile(importer, filename, searchPath)); return ISymUnmanagedReader.Wrap(this.WrappedObject.GetReaderForFile(importer, filename, searchPath));
} }
public ISymUnmanagedReader GetReaderFromStream(object importer, IStream pstream) public ISymUnmanagedReader GetReaderFromStream(object importer, Debugger.Wrappers.CorDebug.IStream pstream)
{ {
return ISymUnmanagedReader.Wrap(this.WrappedObject.GetReaderFromStream(importer, pstream.WrappedObject)); return ISymUnmanagedReader.Wrap(this.WrappedObject.GetReaderFromStream(importer, pstream.WrappedObject));
} }

10
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Wrappers/MetaData/MetaDataImport.cs

@ -41,6 +41,16 @@ namespace Debugger.Wrappers.MetaData
} }
} }
public ISymUnmanagedReader GetSymReader(Debugger.Wrappers.CorDebug.IStream stream)
{
try {
ISymUnmanagedBinder symBinder = new ISymUnmanagedBinder(new Debugger.Interop.CorSym.CorSymBinder_SxSClass());
return symBinder.GetReaderFromStream(metaData, stream);
} catch {
return null;
}
}
~MetaDataImport() ~MetaDataImport()
{ {
Dispose(); Dispose();

Loading…
Cancel
Save