Debugger UI skeleton.

This commit is contained in:
Ben Vanik
2015-05-22 14:58:56 -07:00
parent 8a5d3526e5
commit 969badd8c3
51 changed files with 1555 additions and 12 deletions

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xenia.Debug.Utilities;
namespace Xenia.Debug {
public class Breakpoint : Changeable {
// type code/data/kernel
// address+[end address]
// conditions? script?
// action (suspend, trace, etc)
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xenia.Debug.Utilities;
namespace Xenia.Debug {
public class BreakpointList : Changeable {
private readonly List<Breakpoint> breakpoints = new List<Breakpoint>();
public void Add(Breakpoint breakpoint) {
}
public void Remove(Breakpoint breakpoint) {
}
public void Clear() {
}
}
}

View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Xenia.Debug {
public class Callstack {
}
}

View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Xenia.Debug {
public class DebugClient {
}
}

View File

@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Xenia.Debug {
public class Debugger {
public DebugClient DebugClient {
get;
}
public BreakpointList BreakpointList {
get;
}
public FunctionList FunctionList {
get;
}
public Memory Memory {
get;
}
public ModuleList ModuleList {
get;
}
public ThreadList ThreadList {
get;
}
public Debugger() {
this.DebugClient = new DebugClient();
this.BreakpointList = new BreakpointList();
this.FunctionList = new FunctionList();
this.Memory = new Memory();
this.ModuleList = new ModuleList();
this.ThreadList = new ThreadList();
}
public bool Open() {
return true;
}
public delegate void ChangedEventHandler(EventArgs e);
public event ChangedEventHandler Changed;
private void OnChanged(EventArgs e) {
if (Changed != null) {
Changed(e);
}
}
}
}

View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xenia.Debug.Utilities;
namespace Xenia.Debug {
public class Function : Changeable {
}
}

View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xenia.Debug.Utilities;
namespace Xenia.Debug {
public class FunctionList : Changeable {
}
}

14
src/Xenia.Debug/Memory.cs Normal file
View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xenia.Debug.Utilities;
namespace Xenia.Debug {
public class Memory : Changeable {
public MemoryView CreateView() {
return new MemoryView(this);
}
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xenia.Debug.Utilities;
namespace Xenia.Debug {
public class MemoryView : Changeable {
private readonly Memory memory;
public MemoryView(Memory memory) {
this.memory = memory;
}
}
}

11
src/Xenia.Debug/Module.cs Normal file
View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xenia.Debug.Utilities;
namespace Xenia.Debug {
public class Module : Changeable {
}
}

View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xenia.Debug.Utilities;
namespace Xenia.Debug {
public class ModuleList : Changeable {
}
}

14
src/Xenia.Debug/Thread.cs Normal file
View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xenia.Debug.Utilities;
namespace Xenia.Debug {
public class ThreadContext {
}
public class Thread : Changeable {
}
}

View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xenia.Debug.Utilities;
namespace Xenia.Debug {
public class ThreadList : Changeable {
}
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Xenia.Debug.Utilities {
public delegate void ChangedEventHandler();
public class Changeable {
private int changeDepth;
public event ChangedEventHandler Changed;
protected void BeginChanging() {
++changeDepth;
}
protected void EndChanging() {
if (--changeDepth == 0) {
OnChanged();
}
}
protected void OnChanged() {
System.Diagnostics.Debug.Assert(changeDepth == 0);
if (Changed != null) {
Changed();
}
}
}
}

View File

@@ -43,7 +43,21 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Breakpoint.cs" />
<Compile Include="BreakpointList.cs" />
<Compile Include="Callstack.cs" />
<Compile Include="DebugClient.cs" />
<Compile Include="Debugger.cs" />
<Compile Include="Function.cs" />
<Compile Include="FunctionList.cs" />
<Compile Include="Memory.cs" />
<Compile Include="MemoryView.cs" />
<Compile Include="Module.cs" />
<Compile Include="ModuleList.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Thread.cs" />
<Compile Include="ThreadList.cs" />
<Compile Include="Utilities\Changeable.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.