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. 19
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/BreakpointCollection.cs
  4. 18
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/EvalCollection.cs
  5. 15
      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. 19
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/ProcessCollection.cs
  9. 19
      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 @@
<Compile Include="Src\Control\AppDomain.cs" /> <Compile Include="Src\Control\AppDomain.cs" />
<Compile Include="Src\Control\Eval.cs" /> <Compile Include="Src\Control\Eval.cs" />
<Compile Include="Src\Control\Module.cs" /> <Compile Include="Src\Control\Module.cs" />
<Compile Include="Src\Control\NDebugger-Breakpoints.cs" /> <Compile Include="Src\Control\BreakpointCollection.cs" />
<Compile Include="Src\Control\NDebugger-Processes.cs" /> <Compile Include="Src\Control\ProcessCollection.cs" />
<Compile Include="Src\Control\NDebugger.cs" /> <Compile Include="Src\Control\NDebugger.cs" />
<Compile Include="Src\Control\Process-AppDomains.cs" /> <Compile Include="Src\Control\AppDomainCollection.cs" />
<Compile Include="Src\Control\Process-Evals.cs" /> <Compile Include="Src\Control\EvalCollection.cs" />
<Compile Include="Src\Control\Process-Modules.cs" /> <Compile Include="Src\Control\ModuleCollection.cs" />
<Compile Include="Src\Control\Process-StateControl.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\Process.cs" />
<Compile Include="Src\Control\StackFrame.cs" /> <Compile Include="Src\Control\StackFrame.cs" />
<Compile Include="Src\Control\Stepper.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

19
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;
namespace Debugger namespace Debugger
{ {
public partial class NDebugger
{
BreakpointCollection breakpoints;
public BreakpointCollection Breakpoints {
get { return breakpoints; }
}
}
public class BreakpointCollection: CollectionWithEvents<Breakpoint> public class BreakpointCollection: CollectionWithEvents<Breakpoint>
{ {
public event EventHandler<CollectionItemEventArgs<Breakpoint>> Hit; public event EventHandler<CollectionItemEventArgs<Breakpoint>> Hit;
@ -31,13 +22,10 @@ namespace Debugger
} }
} }
public BreakpointCollection(NDebugger debugger):base(debugger) public BreakpointCollection(NDebugger debugger):base(debugger) { }
{
}
internal Breakpoint Get(ICorDebugBreakpoint corBreakpoint) internal Breakpoint this[ICorDebugBreakpoint corBreakpoint] {
{ get {
foreach (Breakpoint breakpoint in this) { foreach (Breakpoint breakpoint in this) {
if (breakpoint.IsOwnerOf(corBreakpoint)) { if (breakpoint.IsOwnerOf(corBreakpoint)) {
return breakpoint; return breakpoint;
@ -45,6 +33,7 @@ namespace Debugger
} }
return null; return null;
} }
}
public new void Add(Breakpoint breakpoint) public new void Add(Breakpoint breakpoint)
{ {

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

@ -11,25 +11,12 @@ using Debugger.Wrappers.CorDebug;
namespace Debugger 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 class EvalCollection: CollectionWithEvents<Eval>
{ {
public EvalCollection(NDebugger debugger): base(debugger) {} public EvalCollection(NDebugger debugger): base(debugger) {}
internal Eval Get(ICorDebugEval corEval) internal Eval this[ICorDebugEval corEval] {
{ get {
foreach(Eval eval in this) { foreach(Eval eval in this) {
if (eval.IsCorEval(corEval)) { if (eval.IsCorEval(corEval)) {
return eval; return eval;
@ -38,4 +25,5 @@ namespace Debugger
throw new DebuggerException("Eval not found for given ICorDebugEval"); throw new DebuggerException("Eval not found for given ICorDebugEval");
} }
} }
}
} }

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

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

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

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

@ -18,6 +18,10 @@ namespace Debugger
ICorDebugProcess corProcess; ICorDebugProcess corProcess;
ManagedCallback callbackInterface; ManagedCallback callbackInterface;
EvalCollection activeEvals;
ModuleCollection modules;
ThreadCollection threads;
#region IExpirable #region IExpirable
bool hasExited = false; bool hasExited = false;
@ -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) internal Process(NDebugger debugger, ICorDebugProcess corProcess)
{ {
this.debugger = debugger; this.debugger = debugger;
@ -72,7 +97,7 @@ namespace Debugger
this.callbackInterface = new ManagedCallback(this); this.callbackInterface = new ManagedCallback(this);
evals = new EvalCollection(debugger); activeEvals = new EvalCollection(debugger);
modules = new ModuleCollection(debugger); modules = new ModuleCollection(debugger);
threads = new ThreadCollection(debugger); threads = new ThreadCollection(debugger);
} }

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

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

19
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;
namespace Debugger 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 class ThreadCollection: CollectionWithEvents<Thread>
{ {
public ThreadCollection(NDebugger debugger): base(debugger) {} public ThreadCollection(NDebugger debugger): base(debugger) {}
@ -45,8 +31,8 @@ namespace Debugger
return false; return false;
} }
internal Thread Get(ICorDebugThread corThread) internal Thread this[ICorDebugThread corThread] {
{ get {
foreach(Thread thread in this) { foreach(Thread thread in this) {
if (thread.CorThread == corThread) { if (thread.CorThread == corThread) {
return thread; return thread;
@ -55,4 +41,5 @@ namespace Debugger
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
void EnterCallback(PausedReason pausedReason, string name, ICorDebugThread pThread) void EnterCallback(PausedReason pausedReason, string name, ICorDebugThread pThread)
{ {
EnterCallback(pausedReason, name, pThread.Process); EnterCallback(pausedReason, name, pThread.Process);
process.SelectedThread = process.Threads.Get(pThread); process.SelectedThread = process.Threads[pThread];
} }
void ExitCallback() void ExitCallback()
@ -123,7 +123,7 @@ namespace Debugger
{ {
EnterCallback(PausedReason.StepComplete, "StepComplete (" + reason.ToString() + ")", pThread); EnterCallback(PausedReason.StepComplete, "StepComplete (" + reason.ToString() + ")", pThread);
Thread thread = process.Threads.Get(pThread); Thread thread = process.Threads[pThread];
Stepper stepper = thread.GetStepper(pStepper); Stepper stepper = thread.GetStepper(pStepper);
StackFrame currentStackFrame = process.SelectedThread.MostRecentStackFrame; StackFrame currentStackFrame = process.SelectedThread.MostRecentStackFrame;
@ -164,7 +164,7 @@ namespace Debugger
{ {
EnterCallback(PausedReason.Breakpoint, "Breakpoint", pThread); 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 // The event will be risen outside the callback
process.BreakpointHitEventQueue.Enqueue(breakpoint); process.BreakpointHitEventQueue.Enqueue(breakpoint);
@ -256,7 +256,7 @@ namespace Debugger
void HandleEvalComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugEval corEval, bool exception) void HandleEvalComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugEval corEval, bool exception)
{ {
// Let the eval know that the CorEval has finished // Let the eval know that the CorEval has finished
Eval eval = process.ActiveEvals.Get(corEval); Eval eval = process.ActiveEvals[corEval];
eval.NotifyEvaluationComplete(!exception); eval.NotifyEvaluationComplete(!exception);
process.ActiveEvals.Remove(eval); process.ActiveEvals.Remove(eval);
@ -354,7 +354,7 @@ namespace Debugger
EnterCallback(PausedReason.Other, "NameChange: pThread", pThread); EnterCallback(PausedReason.Other, "NameChange: pThread", pThread);
Thread thread = process.Threads.Get(pThread); Thread thread = process.Threads[pThread];
thread.NotifyNameChanged(); thread.NotifyNameChanged();
ExitCallback(); ExitCallback();
@ -395,7 +395,7 @@ namespace Debugger
{ {
EnterCallback(PausedReason.Other, "UnloadModule", pAppDomain); EnterCallback(PausedReason.Other, "UnloadModule", pAppDomain);
process.Modules.Remove(process.Modules.Get(pModule)); process.Modules.Remove(process.Modules[pModule]);
ExitCallback(); ExitCallback();
} }
@ -413,7 +413,7 @@ namespace Debugger
if (process.Threads.Contains(pThread)) { if (process.Threads.Contains(pThread)) {
EnterCallback(PausedReason.Other, "ExitThread " + pThread.ID, pThread); EnterCallback(PausedReason.Other, "ExitThread " + pThread.ID, pThread);
process.Threads.Get(pThread).NotifyExited(); process.Threads[pThread].NotifyExited();
} else { } else {
EnterCallback(PausedReason.Other, "ExitThread " + pThread.ID, process.CorProcess); 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
public ManagedCallback GetProcessCallbackInterface(string name, ICorDebugProcess pProcess) 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 // Make *really* sure the process is not dead
if (process == null) { if (process == null) {
debugger.TraceMessage("Ignoring callback \"" + name + "\": Process not found"); 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
this.corElementType = (CorElementType)corType.Type; this.corElementType = (CorElementType)corType.Type;
if (this.IsClass || this.IsValueType) { 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); this.classProps = module.MetaData.GetTypeDefProps(corType.Class.Token);
} }
@ -476,7 +476,7 @@ namespace Debugger.MetaData
static public DebugType Create(Process process, ICorDebugClass corClass, params ICorDebugType[] typeArguments) 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; bool isValueType = false;
uint superClassToken = metaData.GetTypeDefProps(corClass.Token).SuperClassToken; 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 {
<ModuleLoaded>MainThreadExit.exe (Has symbols)</ModuleLoaded> <ModuleLoaded>MainThreadExit.exe (Has symbols)</ModuleLoaded>
<DebuggingPaused>Break MainThreadExit.cs:24,4-24,40</DebuggingPaused> <DebuggingPaused>Break MainThreadExit.cs:24,4-24,40</DebuggingPaused>
<ThreadsBeforeExit <ThreadsBeforeExit
Count="2"> Count="2"
Selected="Thread Name = Suspended = False">
<Item> <Item>
<Thread <Thread
CurrentExceptionType="0" CurrentExceptionType="0"
@ -91,7 +92,8 @@ namespace Debugger.Tests {
</ThreadsBeforeExit> </ThreadsBeforeExit>
<DebuggingPaused>ForcedBreak MainThreadExit.cs:29,4-29,26</DebuggingPaused> <DebuggingPaused>ForcedBreak MainThreadExit.cs:29,4-29,26</DebuggingPaused>
<ThreadsAfterExit <ThreadsAfterExit
Count="2"> Count="2"
Selected="Thread Name = Worker thread Suspended = False">
<Item> <Item>
<Thread <Thread
CurrentExceptionType="0" CurrentExceptionType="0"

Loading…
Cancel
Save