Browse Source

Renaming files accordingly and some final touches

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4515 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 16 years ago
parent
commit
e89dd70d3c
  1. 12
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Debugger.Core.csproj
  2. 0
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/AppDomainCollection.cs
  3. 27
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/BreakpointCollection.cs
  4. 26
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/EvalCollection.cs
  5. 23
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/ModuleCollection.cs
  6. 11
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/NDebugger.cs
  7. 27
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process.cs
  8. 27
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/ProcessCollection.cs
  9. 27
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/ThreadCollection.cs
  10. 14
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Internal/ManagedCallback.cs
  11. 2
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Internal/ManagedCallbackSwitch.cs
  12. 4
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs
  13. 6
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/MainThreadExit.cs

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

@ -60,14 +60,14 @@ @@ -60,14 +60,14 @@
<Compile Include="Src\Control\AppDomain.cs" />
<Compile Include="Src\Control\Eval.cs" />
<Compile Include="Src\Control\Module.cs" />
<Compile Include="Src\Control\NDebugger-Breakpoints.cs" />
<Compile Include="Src\Control\NDebugger-Processes.cs" />
<Compile Include="Src\Control\BreakpointCollection.cs" />
<Compile Include="Src\Control\ProcessCollection.cs" />
<Compile Include="Src\Control\NDebugger.cs" />
<Compile Include="Src\Control\Process-AppDomains.cs" />
<Compile Include="Src\Control\Process-Evals.cs" />
<Compile Include="Src\Control\Process-Modules.cs" />
<Compile Include="Src\Control\AppDomainCollection.cs" />
<Compile Include="Src\Control\EvalCollection.cs" />
<Compile Include="Src\Control\ModuleCollection.cs" />
<Compile Include="Src\Control\Process-StateControl.cs" />
<Compile Include="Src\Control\Process-Threads.cs" />
<Compile Include="Src\Control\ThreadCollection.cs" />
<Compile Include="Src\Control\Process.cs" />
<Compile Include="Src\Control\StackFrame.cs" />
<Compile Include="Src\Control\Stepper.cs" />

0
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process-AppDomains.cs → src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/AppDomainCollection.cs

27
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/NDebugger-Breakpoints.cs → src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/BreakpointCollection.cs

@ -11,15 +11,6 @@ using Debugger.Wrappers.CorDebug; @@ -11,15 +11,6 @@ using Debugger.Wrappers.CorDebug;
namespace Debugger
{
public partial class NDebugger
{
BreakpointCollection breakpoints;
public BreakpointCollection Breakpoints {
get { return breakpoints; }
}
}
public class BreakpointCollection: CollectionWithEvents<Breakpoint>
{
public event EventHandler<CollectionItemEventArgs<Breakpoint>> Hit;
@ -31,19 +22,17 @@ namespace Debugger @@ -31,19 +22,17 @@ namespace Debugger
}
}
public BreakpointCollection(NDebugger debugger):base(debugger)
{
}
public BreakpointCollection(NDebugger debugger):base(debugger) { }
internal Breakpoint Get(ICorDebugBreakpoint corBreakpoint)
{
foreach (Breakpoint breakpoint in this) {
if (breakpoint.IsOwnerOf(corBreakpoint)) {
return breakpoint;
internal Breakpoint this[ICorDebugBreakpoint corBreakpoint] {
get {
foreach (Breakpoint breakpoint in this) {
if (breakpoint.IsOwnerOf(corBreakpoint)) {
return breakpoint;
}
}
return null;
}
return null;
}
public new void Add(Breakpoint breakpoint)

26
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process-Evals.cs → src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/EvalCollection.cs

@ -11,31 +11,19 @@ using Debugger.Wrappers.CorDebug; @@ -11,31 +11,19 @@ using Debugger.Wrappers.CorDebug;
namespace Debugger
{
public partial class Process
{
EvalCollection evals;
public EvalCollection ActiveEvals {
get { return evals; }
}
internal bool Evaluating {
get { return evals.Count > 0; }
}
}
public class EvalCollection: CollectionWithEvents<Eval>
{
public EvalCollection(NDebugger debugger): base(debugger) {}
internal Eval Get(ICorDebugEval corEval)
{
foreach(Eval eval in this) {
if (eval.IsCorEval(corEval)) {
return eval;
internal Eval this[ICorDebugEval corEval] {
get {
foreach(Eval eval in this) {
if (eval.IsCorEval(corEval)) {
return eval;
}
}
throw new DebuggerException("Eval not found for given ICorDebugEval");
}
throw new DebuggerException("Eval not found for given ICorDebugEval");
}
}
}

23
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process-Modules.cs → src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/ModuleCollection.cs

@ -12,15 +12,6 @@ using Debugger.Wrappers.CorDebug; @@ -12,15 +12,6 @@ using Debugger.Wrappers.CorDebug;
namespace Debugger
{
public partial class Process
{
ModuleCollection modules;
public ModuleCollection Modules {
get { return modules; }
}
}
public class ModuleCollection: CollectionWithEvents<Module>
{
public ModuleCollection(NDebugger debugger):base (debugger) {}
@ -38,15 +29,15 @@ namespace Debugger @@ -38,15 +29,15 @@ namespace Debugger
}
}
internal Module Get(ICorDebugModule corModule)
{
foreach(Module module in this) {
if (module.CorModule == corModule) {
return module;
internal Module this[ICorDebugModule corModule] {
get {
foreach(Module module in this) {
if (module.CorModule == corModule) {
return module;
}
}
throw new DebuggerException("Module is not in collection");
}
throw new DebuggerException("Module is not in collection");
}
protected override void OnAdded(Module module)

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

@ -22,6 +22,9 @@ namespace Debugger @@ -22,6 +22,9 @@ namespace Debugger
ManagedCallbackSwitch managedCallbackSwitch;
ManagedCallbackProxy managedCallbackProxy;
BreakpointCollection breakpoints;
ProcessCollection processes;
MTA2STA mta2sta = new MTA2STA();
string debuggeeVersion;
@ -51,6 +54,14 @@ namespace Debugger @@ -51,6 +54,14 @@ namespace Debugger
set { options = value; }
}
public BreakpointCollection Breakpoints {
get { return breakpoints; }
}
public ProcessCollection Processes {
get { return processes; }
}
public NDebugger()
{
processes = new ProcessCollection(this);

27
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process.cs

@ -18,6 +18,10 @@ namespace Debugger @@ -18,6 +18,10 @@ namespace Debugger
ICorDebugProcess corProcess;
ManagedCallback callbackInterface;
EvalCollection activeEvals;
ModuleCollection modules;
ThreadCollection threads;
#region IExpirable
bool hasExited = false;
@ -65,6 +69,27 @@ namespace Debugger @@ -65,6 +69,27 @@ namespace Debugger
}
}
public EvalCollection ActiveEvals {
get { return activeEvals; }
}
internal bool Evaluating {
get { return activeEvals.Count > 0; }
}
public ModuleCollection Modules {
get { return modules; }
}
public ThreadCollection Threads {
get { return threads; }
}
public Thread SelectedThread {
get { return this.Threads.Selected; }
set { this.Threads.Selected = value; }
}
internal Process(NDebugger debugger, ICorDebugProcess corProcess)
{
this.debugger = debugger;
@ -72,7 +97,7 @@ namespace Debugger @@ -72,7 +97,7 @@ namespace Debugger
this.callbackInterface = new ManagedCallback(this);
evals = new EvalCollection(debugger);
activeEvals = new EvalCollection(debugger);
modules = new ModuleCollection(debugger);
threads = new ThreadCollection(debugger);
}

27
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/NDebugger-Processes.cs → src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/ProcessCollection.cs

@ -12,30 +12,19 @@ using Debugger.Wrappers.CorDebug; @@ -12,30 +12,19 @@ using Debugger.Wrappers.CorDebug;
namespace Debugger
{
public partial class NDebugger
{
ProcessCollection processes;
public ProcessCollection Processes {
get { return processes; }
}
}
public class ProcessCollection: CollectionWithEvents<Process>
{
public ProcessCollection(NDebugger debugger): base(debugger)
{
}
public ProcessCollection(NDebugger debugger): base(debugger) {}
internal Process Get(ICorDebugProcess corProcess)
{
foreach (Process process in this) {
if (process.CorProcess == corProcess) {
return process;
internal Process this[ICorDebugProcess corProcess] {
get {
foreach (Process process in this) {
if (process.CorProcess == corProcess) {
return process;
}
}
return null;
}
return null;
}
protected override void OnRemoved(Process item)

27
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process-Threads.cs → src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/ThreadCollection.cs

@ -12,20 +12,6 @@ using Debugger.Wrappers.CorDebug; @@ -12,20 +12,6 @@ using Debugger.Wrappers.CorDebug;
namespace Debugger
{
public partial class Process
{
ThreadCollection threads;
public ThreadCollection Threads {
get { return threads; }
}
public Thread SelectedThread {
get { return this.Threads.Selected; }
set { this.Threads.Selected = value; }
}
}
public class ThreadCollection: CollectionWithEvents<Thread>
{
public ThreadCollection(NDebugger debugger): base(debugger) {}
@ -45,14 +31,15 @@ namespace Debugger @@ -45,14 +31,15 @@ namespace Debugger
return false;
}
internal Thread Get(ICorDebugThread corThread)
{
foreach(Thread thread in this) {
if (thread.CorThread == corThread) {
return thread;
internal Thread this[ICorDebugThread corThread] {
get {
foreach(Thread thread in this) {
if (thread.CorThread == corThread) {
return thread;
}
}
throw new DebuggerException("Thread is not in collection");
}
throw new DebuggerException("Thread is not in collection");
}
}
}

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

@ -78,7 +78,7 @@ namespace Debugger @@ -78,7 +78,7 @@ namespace Debugger
void EnterCallback(PausedReason pausedReason, string name, ICorDebugThread pThread)
{
EnterCallback(pausedReason, name, pThread.Process);
process.SelectedThread = process.Threads.Get(pThread);
process.SelectedThread = process.Threads[pThread];
}
void ExitCallback()
@ -123,7 +123,7 @@ namespace Debugger @@ -123,7 +123,7 @@ namespace Debugger
{
EnterCallback(PausedReason.StepComplete, "StepComplete (" + reason.ToString() + ")", pThread);
Thread thread = process.Threads.Get(pThread);
Thread thread = process.Threads[pThread];
Stepper stepper = thread.GetStepper(pStepper);
StackFrame currentStackFrame = process.SelectedThread.MostRecentStackFrame;
@ -164,7 +164,7 @@ namespace Debugger @@ -164,7 +164,7 @@ namespace Debugger
{
EnterCallback(PausedReason.Breakpoint, "Breakpoint", pThread);
Breakpoint breakpoint = process.Debugger.Breakpoints.Get(corBreakpoint);
Breakpoint breakpoint = process.Debugger.Breakpoints[corBreakpoint];
// The event will be risen outside the callback
process.BreakpointHitEventQueue.Enqueue(breakpoint);
@ -256,7 +256,7 @@ namespace Debugger @@ -256,7 +256,7 @@ namespace Debugger
void HandleEvalComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugEval corEval, bool exception)
{
// Let the eval know that the CorEval has finished
Eval eval = process.ActiveEvals.Get(corEval);
Eval eval = process.ActiveEvals[corEval];
eval.NotifyEvaluationComplete(!exception);
process.ActiveEvals.Remove(eval);
@ -354,7 +354,7 @@ namespace Debugger @@ -354,7 +354,7 @@ namespace Debugger
EnterCallback(PausedReason.Other, "NameChange: pThread", pThread);
Thread thread = process.Threads.Get(pThread);
Thread thread = process.Threads[pThread];
thread.NotifyNameChanged();
ExitCallback();
@ -395,7 +395,7 @@ namespace Debugger @@ -395,7 +395,7 @@ namespace Debugger
{
EnterCallback(PausedReason.Other, "UnloadModule", pAppDomain);
process.Modules.Remove(process.Modules.Get(pModule));
process.Modules.Remove(process.Modules[pModule]);
ExitCallback();
}
@ -413,7 +413,7 @@ namespace Debugger @@ -413,7 +413,7 @@ namespace Debugger
if (process.Threads.Contains(pThread)) {
EnterCallback(PausedReason.Other, "ExitThread " + pThread.ID, pThread);
process.Threads.Get(pThread).NotifyExited();
process.Threads[pThread].NotifyExited();
} else {
EnterCallback(PausedReason.Other, "ExitThread " + pThread.ID, process.CorProcess);

2
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Internal/ManagedCallbackSwitch.cs

@ -73,7 +73,7 @@ namespace Debugger @@ -73,7 +73,7 @@ namespace Debugger
public ManagedCallback GetProcessCallbackInterface(string name, ICorDebugProcess pProcess)
{
Process process = debugger.Processes.Get(pProcess);
Process process = debugger.Processes[pProcess];
// Make *really* sure the process is not dead
if (process == null) {
debugger.TraceMessage("Ignoring callback \"" + name + "\": Process not found");

4
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs

@ -337,7 +337,7 @@ namespace Debugger.MetaData @@ -337,7 +337,7 @@ namespace Debugger.MetaData
this.corElementType = (CorElementType)corType.Type;
if (this.IsClass || this.IsValueType) {
this.module = process.Modules.Get(corType.Class.Module);
this.module = process.Modules[corType.Class.Module];
this.classProps = module.MetaData.GetTypeDefProps(corType.Class.Token);
}
@ -476,7 +476,7 @@ namespace Debugger.MetaData @@ -476,7 +476,7 @@ namespace Debugger.MetaData
static public DebugType Create(Process process, ICorDebugClass corClass, params ICorDebugType[] typeArguments)
{
MetaDataImport metaData = process.Modules.Get(corClass.Module).MetaData;
MetaDataImport metaData = process.Modules[corClass.Module].MetaData;
bool isValueType = false;
uint superClassToken = metaData.GetTypeDefProps(corClass.Token).SuperClassToken;

6
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/MainThreadExit.cs

@ -62,7 +62,8 @@ namespace Debugger.Tests { @@ -62,7 +62,8 @@ namespace Debugger.Tests {
<ModuleLoaded>MainThreadExit.exe (Has symbols)</ModuleLoaded>
<DebuggingPaused>Break MainThreadExit.cs:24,4-24,40</DebuggingPaused>
<ThreadsBeforeExit
Count="2">
Count="2"
Selected="Thread Name = Suspended = False">
<Item>
<Thread
CurrentExceptionType="0"
@ -91,7 +92,8 @@ namespace Debugger.Tests { @@ -91,7 +92,8 @@ namespace Debugger.Tests {
</ThreadsBeforeExit>
<DebuggingPaused>ForcedBreak MainThreadExit.cs:29,4-29,26</DebuggingPaused>
<ThreadsAfterExit
Count="2">
Count="2"
Selected="Thread Name = Worker thread Suspended = False">
<Item>
<Thread
CurrentExceptionType="0"

Loading…
Cancel
Save