Browse Source

Added Module.GetNamesOfDefinedTypes - this one includes generic types

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3112 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 17 years ago
parent
commit
395b525929
  1. 11
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Module.cs
  2. 8
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/DefinedTypes.cs

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

@ -128,11 +128,22 @@ namespace Debugger
} }
} }
/// <summary> Get all non-generic types defined in this module </summary>
public List<DebugType> GetDefinedTypes() public List<DebugType> GetDefinedTypes()
{ {
return DebugType.GetDefinedTypesInModule(this); return DebugType.GetDefinedTypesInModule(this);
} }
/// <summary> Get names of all generic and non-generic types defined in this module </summary>
public List<string> GetNamesOfDefinedTypes()
{
List<string> names = new List<string>();
foreach(TypeDefProps typeProps in this.MetaData.EnumTypeDefs()) {
names.Add(typeProps.Name);
}
return names;
}
internal Module(Process process, ICorDebugModule pModule) internal Module(Process process, ICorDebugModule pModule)
{ {
this.process = process; this.process = process;

8
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/DefinedTypes.cs

@ -37,6 +37,7 @@ namespace Debugger.Tests {
{ {
StartTest("DefinedTypes.cs"); StartTest("DefinedTypes.cs");
ObjectDump("TypesAsString", process.GetModule("DefinedTypes.exe").GetNamesOfDefinedTypes());
ObjectDump("Types", process.GetModule("DefinedTypes.exe").GetDefinedTypes()); ObjectDump("Types", process.GetModule("DefinedTypes.exe").GetDefinedTypes());
EndTest(); EndTest();
@ -53,6 +54,13 @@ namespace Debugger.Tests {
<ModuleLoaded symbols="False">mscorlib.dll</ModuleLoaded> <ModuleLoaded symbols="False">mscorlib.dll</ModuleLoaded>
<ModuleLoaded symbols="True">DefinedTypes.exe</ModuleLoaded> <ModuleLoaded symbols="True">DefinedTypes.exe</ModuleLoaded>
<DebuggingPaused>Break</DebuggingPaused> <DebuggingPaused>Break</DebuggingPaused>
<TypesAsString Type="List`1" ToString="System.Collections.Generic.List`1[System.String]">
<Capacity>4</Capacity>
<Count>3</Count>
<Item>Debugger.Tests.TestPrograms.DefinedTypes_Class</Item>
<Item>Debugger.Tests.TestPrograms.DefinedTypes_Struct</Item>
<Item>Debugger.Tests.TestPrograms.DefinedTypes_GenericClass`2</Item>
</TypesAsString>
<Types Type="List`1" ToString="System.Collections.Generic.List`1[Debugger.MetaData.DebugType]"> <Types Type="List`1" ToString="System.Collections.Generic.List`1[Debugger.MetaData.DebugType]">
<Capacity>4</Capacity> <Capacity>4</Capacity>
<Count>2</Count> <Count>2</Count>

Loading…
Cancel
Save