Fleshing out debugger types.

This commit is contained in:
Ben Vanik
2015-05-24 13:43:15 -07:00
parent da655d15b3
commit e55be7d2c9
103 changed files with 4008 additions and 2025 deletions

View File

@@ -6,5 +6,14 @@ using System.Threading.Tasks;
namespace Xenia.Debug {
public class Callstack {
public class Frame {
// function
// address
// stack pointer
// possible to get args?
}
// thread
// frames
}
}

View File

@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xenia.Debug.Utilities;
namespace Xenia.Debug {
public enum RunState {
Updating,
Running,
Paused,
}
public class Context : Changeable {
private readonly Debugger debugger;
public Context(Debugger debugger) {
this.debugger = debugger;
}
public RunState RunState {
get; private set;
}
public void SetRunState(RunState runState) {
if (RunState == runState) {
return;
}
RunState = runState;
OnChanged();
}
public uint CurrentThreadId {
get; private set;
}
public void SetThreadId(uint threadId) {
if (CurrentThreadId == threadId) {
return;
}
CurrentThreadId = threadId;
OnChanged();
}
}
}

View File

@@ -35,16 +35,13 @@ namespace Xenia.Debug {
private uint nextRequestId = 1;
private FileMappingHandle memoryHandle;
public IntPtr Membase {
get;
}
public unsafe byte* TranslateVirtual(uint address) {
return (byte*)Membase.ToPointer() + address;
return (byte*)Memory.VirtualMembase.ToPointer() + address;
}
public unsafe byte* TranslatePhysical(uint address) {
return (byte*)Membase.ToPointer() + 0xFFFFFFFF + address;
return (byte*)Memory.PhysicalMembase.ToPointer() + 0xFFFFFFFF + address;
}
public event EventHandler<State> StateChanged;
@@ -54,30 +51,22 @@ namespace Xenia.Debug {
}
= State.Idle;
public BreakpointList BreakpointList {
get;
}
public FunctionList FunctionList {
get;
}
public Memory Memory {
get;
}
public ModuleList ModuleList {
get;
}
public ThreadList ThreadList {
get;
}
public readonly Context CurrentContext;
public readonly BreakpointList BreakpointList;
public readonly Memory Memory;
public readonly ModuleList ModuleList;
public readonly ThreadList ThreadList;
public Debugger(AsyncTaskRunner asyncTaskRunner) {
Dispatch.AsyncTaskRunner = asyncTaskRunner;
this.BreakpointList = new BreakpointList(this);
this.FunctionList = new FunctionList(this);
this.Memory = new Memory(this);
this.ModuleList = new ModuleList(this);
this.ThreadList = new ThreadList(this);
this.CurrentContext = new Context(this);
}
public Task Attach() {
@@ -91,8 +80,7 @@ namespace Xenia.Debug {
NetworkAccess.Connect,
TransportType.Tcp,
kServerHostname,
kServerPort
);
kServerPort);
permission.Demand();
IPAddress ipAddress = new IPAddress(new byte[] { 127, 0, 0, 1 });
@@ -282,5 +270,96 @@ namespace Xenia.Debug {
StateChanged(this, newState);
}
}
private async Task BeginRunStateTransition() {
CurrentContext.SetRunState(RunState.Updating);
}
private async Task CompleteRunStateTransition(RunState newRunState) {
await Task.WhenAll(new Task[] {
ModuleList.Invalidate(),
});
CurrentContext.SetRunState(newRunState);
}
public async Task<StopResponse> Stop() {
await BeginRunStateTransition();
var fbb = BeginRequest();
StopRequest.StartStopRequest(fbb);
int requestDataOffset = StopRequest.EndStopRequest(fbb);
var response = await CommitRequest(fbb, RequestData.StopRequest, requestDataOffset);
System.Diagnostics.Debug.Assert(response.ResponseDataType ==
ResponseData.StopResponse);
var stopResponse = new StopResponse();
response.GetResponseData(stopResponse);
await CompleteRunStateTransition(RunState.Paused);
return stopResponse;
}
public async Task<BreakResponse> Break() {
await BeginRunStateTransition();
var fbb = BeginRequest();
BreakRequest.StartBreakRequest(fbb);
int requestDataOffset = BreakRequest.EndBreakRequest(fbb);
var response = await CommitRequest(fbb, RequestData.BreakRequest, requestDataOffset);
System.Diagnostics.Debug.Assert(response.ResponseDataType ==
ResponseData.BreakResponse);
var breakResponse = new BreakResponse();
response.GetResponseData(breakResponse);
await CompleteRunStateTransition(RunState.Paused);
return breakResponse;
}
public async Task<ContinueResponse> Continue() {
await BeginRunStateTransition();
var fbb = BeginRequest();
int requestDataOffset = ContinueRequest.CreateContinueRequest(fbb, ContinueAction.Continue, 0);
var response = await CommitRequest(fbb, RequestData.ContinueRequest, requestDataOffset);
System.Diagnostics.Debug.Assert(response.ResponseDataType ==
ResponseData.ContinueResponse);
var continueResponse = new ContinueResponse();
response.GetResponseData(continueResponse);
await CompleteRunStateTransition(RunState.Running);
return continueResponse;
}
public async Task<ContinueResponse> ContinueTo(uint targetAddress) {
await BeginRunStateTransition();
var fbb = BeginRequest();
int requestDataOffset = ContinueRequest.CreateContinueRequest(fbb, ContinueAction.ContinueTo, targetAddress);
var response = await CommitRequest(fbb, RequestData.ContinueRequest, requestDataOffset);
System.Diagnostics.Debug.Assert(response.ResponseDataType ==
ResponseData.ContinueResponse);
var continueResponse = new ContinueResponse();
response.GetResponseData(continueResponse);
await CompleteRunStateTransition(RunState.Running);
return continueResponse;
}
public async Task<StepResponse> StepIn() {
return await Step(StepAction.StepIn, CurrentContext.CurrentThreadId);
}
public async Task<StepResponse> StepOver() {
return await Step(StepAction.StepOver, CurrentContext.CurrentThreadId);
}
public async Task<StepResponse> StepOut() {
return await Step(StepAction.StepOut, CurrentContext.CurrentThreadId);
}
private async Task<StepResponse> Step(StepAction stepAction, uint threadId) {
await BeginRunStateTransition();
var fbb = BeginRequest();
int requestDataOffset = StepRequest.CreateStepRequest(fbb, stepAction, threadId);
var response = await CommitRequest(fbb, RequestData.StepRequest, requestDataOffset);
System.Diagnostics.Debug.Assert(response.ResponseDataType ==
ResponseData.StepResponse);
var stepResponse = new StepResponse();
response.GetResponseData(stepResponse);
await CompleteRunStateTransition(RunState.Paused);
return stepResponse;
}
}
}

View File

@@ -7,5 +7,27 @@ using Xenia.Debug.Utilities;
namespace Xenia.Debug {
public class Function : Changeable {
// status: declared, defined, failed
// module
// name
// startAddress
// endAddress
// behavior: default, prolog, epilog, epilog_return, extern
// extern info?
// source map
// disasm:
// source
// raw hir
// hir
// machine code
// trace data:
// intptr into file mapping
// function_thread_use bitmask
// call count
// caller history
// instruction execution counts
}
}

View File

@@ -1,32 +0,0 @@
using System;
using System.Collections;
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, IReadOnlyCollection<Function> {
private readonly Debugger debugger;
private readonly List<Function> functions = new List<Function>();
public FunctionList(Debugger debugger) {
this.debugger = debugger;
}
public int Count {
get {
return functions.Count;
}
}
public IEnumerator<Function> GetEnumerator() {
return functions.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator() {
return functions.GetEnumerator();
}
}
}

View File

@@ -0,0 +1,18 @@
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 KernelObject : Changeable {
public readonly Debugger Debugger;
public readonly uint Handle;
public KernelObject(Debugger debugger, uint handle) {
this.Debugger = debugger;
this.Handle = handle;
}
}
}

View File

@@ -12,5 +12,17 @@ namespace Xenia.Debug {
public MemoryView(Memory memory) {
this.memory = memory;
}
// startAddress
// endAddress
// padding: 2 64k pages on each side?
// history (last N snapshots)
// snapshot on break, or manually
// colored: text on modification
// bg on heap alloc #
// focus details: protection, region, allocation
// stacks for all allocations
}
}

View File

@@ -1,11 +1,48 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using xe.debug.proto;
using Xenia.Debug.Utilities;
namespace Xenia.Debug {
public class Module : Changeable {
public class Module : KernelObject, IReadOnlyCollection<Function> {
private readonly List<Function> functions = new List<Function>();
// xobject: handle
// path
// type: user, kernel
// if user:
// xex header?
public Module(Debugger debugger, uint moduleHandle) : base(debugger, moduleHandle) {
}
public async Task Invalidate() {
var fbb = Debugger.BeginRequest();
int requestDataOffset = GetModuleRequest.CreateGetModuleRequest(fbb, Handle);
var response = await Debugger.CommitRequest(
fbb, RequestData.GetModuleRequest, requestDataOffset);
GetModuleResponse responseData = new GetModuleResponse();
response.GetResponseData(responseData);
//
}
public int Count {
get {
return functions.Count;
}
}
public IEnumerator<Function> GetEnumerator() {
return functions.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator() {
return functions.GetEnumerator();
}
}
}

View File

@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using xe.debug.proto;
using Xenia.Debug.Utilities;
namespace Xenia.Debug {
@@ -15,6 +16,32 @@ namespace Xenia.Debug {
this.debugger = debugger;
}
public async Task Invalidate() {
var fbb = debugger.BeginRequest();
ListModulesRequest.StartListModulesRequest(fbb);
int requestDataOffset = ListModulesRequest.EndListModulesRequest(fbb);
var response = await debugger.CommitRequest(
fbb, RequestData.ListModulesRequest, requestDataOffset);
ListModulesResponse responseData = new ListModulesResponse();
response.GetResponseData(responseData);
var pendingTasks = new List<Task>();
for (int i = 0; i < responseData.ModuleIdsLength; ++i) {
uint moduleHandle = responseData.GetModuleIds(i);
var module = modules.Find((m) => m.Handle == moduleHandle);
if (module == null) {
// Module not found.
module = new Module(debugger, moduleHandle);
pendingTasks.Add(module.Invalidate());
} else {
// Module already present.
// Modules are immutable, so ignore?
}
}
await Task.WhenAll(pendingTasks);
}
public int Count {
get {
return modules.Count;

View File

@@ -0,0 +1,35 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class AccessViolationEvent : Table {
public static AccessViolationEvent GetRootAsAccessViolationEvent(ByteBuffer _bb) { return GetRootAsAccessViolationEvent(_bb, new AccessViolationEvent()); }
public static AccessViolationEvent GetRootAsAccessViolationEvent(ByteBuffer _bb, AccessViolationEvent obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public AccessViolationEvent __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public uint ThreadId { get { int o = __offset(4); return o != 0 ? bb.GetUint(o + bb_pos) : (uint)0; } }
public uint TargetAddress { get { int o = __offset(6); return o != 0 ? bb.GetUint(o + bb_pos) : (uint)0; } }
public static int CreateAccessViolationEvent(FlatBufferBuilder builder,
uint thread_id = 0,
uint target_address = 0) {
builder.StartObject(2);
AccessViolationEvent.AddTargetAddress(builder, target_address);
AccessViolationEvent.AddThreadId(builder, thread_id);
return AccessViolationEvent.EndAccessViolationEvent(builder);
}
public static void StartAccessViolationEvent(FlatBufferBuilder builder) { builder.StartObject(2); }
public static void AddThreadId(FlatBufferBuilder builder, uint threadId) { builder.AddUint(0, threadId, 0); }
public static void AddTargetAddress(FlatBufferBuilder builder, uint targetAddress) { builder.AddUint(1, targetAddress, 0); }
public static int EndAccessViolationEvent(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -1,22 +0,0 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class AddBreakpointRequest : Table {
public static AddBreakpointRequest GetRootAsAddBreakpointRequest(ByteBuffer _bb) { return GetRootAsAddBreakpointRequest(_bb, new AddBreakpointRequest()); }
public static AddBreakpointRequest GetRootAsAddBreakpointRequest(ByteBuffer _bb, AddBreakpointRequest obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public AddBreakpointRequest __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public static void StartAddBreakpointRequest(FlatBufferBuilder builder) { builder.StartObject(0); }
public static int EndAddBreakpointRequest(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -1,22 +0,0 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class AddBreakpointResponse : Table {
public static AddBreakpointResponse GetRootAsAddBreakpointResponse(ByteBuffer _bb) { return GetRootAsAddBreakpointResponse(_bb, new AddBreakpointResponse()); }
public static AddBreakpointResponse GetRootAsAddBreakpointResponse(ByteBuffer _bb, AddBreakpointResponse obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public AddBreakpointResponse __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public static void StartAddBreakpointResponse(FlatBufferBuilder builder) { builder.StartObject(0); }
public static int EndAddBreakpointResponse(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,34 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class AddBreakpointsRequest : Table {
public static AddBreakpointsRequest GetRootAsAddBreakpointsRequest(ByteBuffer _bb) { return GetRootAsAddBreakpointsRequest(_bb, new AddBreakpointsRequest()); }
public static AddBreakpointsRequest GetRootAsAddBreakpointsRequest(ByteBuffer _bb, AddBreakpointsRequest obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public AddBreakpointsRequest __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public Breakpoint GetBreakpoints(int j) { return GetBreakpoints(new Breakpoint(), j); }
public Breakpoint GetBreakpoints(Breakpoint obj, int j) { int o = __offset(4); return o != 0 ? obj.__init(__vector(o) + j * 4, bb) : null; }
public int BreakpointsLength { get { int o = __offset(4); return o != 0 ? __vector_len(o) : 0; } }
public static int CreateAddBreakpointsRequest(FlatBufferBuilder builder,
int breakpoints = 0) {
builder.StartObject(1);
AddBreakpointsRequest.AddBreakpoints(builder, breakpoints);
return AddBreakpointsRequest.EndAddBreakpointsRequest(builder);
}
public static void StartAddBreakpointsRequest(FlatBufferBuilder builder) { builder.StartObject(1); }
public static void AddBreakpoints(FlatBufferBuilder builder, int breakpointsOffset) { builder.AddOffset(0, breakpointsOffset, 0); }
public static void StartBreakpointsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
public static int EndAddBreakpointsRequest(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,22 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class AddBreakpointsResponse : Table {
public static AddBreakpointsResponse GetRootAsAddBreakpointsResponse(ByteBuffer _bb) { return GetRootAsAddBreakpointsResponse(_bb, new AddBreakpointsResponse()); }
public static AddBreakpointsResponse GetRootAsAddBreakpointsResponse(ByteBuffer _bb, AddBreakpointsResponse obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public AddBreakpointsResponse __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public static void StartAddBreakpointsResponse(FlatBufferBuilder builder) { builder.StartObject(0); }
public static int EndAddBreakpointsResponse(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,22 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class BreakRequest : Table {
public static BreakRequest GetRootAsBreakRequest(ByteBuffer _bb) { return GetRootAsBreakRequest(_bb, new BreakRequest()); }
public static BreakRequest GetRootAsBreakRequest(ByteBuffer _bb, BreakRequest obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public BreakRequest __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public static void StartBreakRequest(FlatBufferBuilder builder) { builder.StartObject(0); }
public static int EndBreakRequest(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,22 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class BreakResponse : Table {
public static BreakResponse GetRootAsBreakResponse(ByteBuffer _bb) { return GetRootAsBreakResponse(_bb, new BreakResponse()); }
public static BreakResponse GetRootAsBreakResponse(ByteBuffer _bb, BreakResponse obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public BreakResponse __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public static void StartBreakResponse(FlatBufferBuilder builder) { builder.StartObject(0); }
public static int EndBreakResponse(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,21 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class Breakpoint : Struct {
public Breakpoint __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public uint BreakpointId { get { return bb.GetUint(bb_pos + 0); } }
public static int CreateBreakpoint(FlatBufferBuilder builder, uint BreakpointId) {
builder.Prep(4, 4);
builder.PutUint(BreakpointId);
return builder.Offset;
}
};
}

View File

@@ -0,0 +1,35 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class BreakpointEvent : Table {
public static BreakpointEvent GetRootAsBreakpointEvent(ByteBuffer _bb) { return GetRootAsBreakpointEvent(_bb, new BreakpointEvent()); }
public static BreakpointEvent GetRootAsBreakpointEvent(ByteBuffer _bb, BreakpointEvent obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public BreakpointEvent __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public uint ThreadId { get { int o = __offset(4); return o != 0 ? bb.GetUint(o + bb_pos) : (uint)0; } }
public uint BreakpointId { get { int o = __offset(6); return o != 0 ? bb.GetUint(o + bb_pos) : (uint)0; } }
public static int CreateBreakpointEvent(FlatBufferBuilder builder,
uint thread_id = 0,
uint breakpoint_id = 0) {
builder.StartObject(2);
BreakpointEvent.AddBreakpointId(builder, breakpoint_id);
BreakpointEvent.AddThreadId(builder, thread_id);
return BreakpointEvent.EndBreakpointEvent(builder);
}
public static void StartBreakpointEvent(FlatBufferBuilder builder) { builder.StartObject(2); }
public static void AddThreadId(FlatBufferBuilder builder, uint threadId) { builder.AddUint(0, threadId, 0); }
public static void AddBreakpointId(FlatBufferBuilder builder, uint breakpointId) { builder.AddUint(1, breakpointId, 0); }
public static int EndBreakpointEvent(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,13 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
public enum ContinueAction : sbyte
{
Continue = 0,
ContinueTo = 1,
};
}

View File

@@ -0,0 +1,35 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class ContinueRequest : Table {
public static ContinueRequest GetRootAsContinueRequest(ByteBuffer _bb) { return GetRootAsContinueRequest(_bb, new ContinueRequest()); }
public static ContinueRequest GetRootAsContinueRequest(ByteBuffer _bb, ContinueRequest obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public ContinueRequest __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public ContinueAction Action { get { int o = __offset(4); return o != 0 ? (ContinueAction)bb.GetSbyte(o + bb_pos) : (ContinueAction)0; } }
public uint TargetAddress { get { int o = __offset(6); return o != 0 ? bb.GetUint(o + bb_pos) : (uint)0; } }
public static int CreateContinueRequest(FlatBufferBuilder builder,
ContinueAction action = 0,
uint target_address = 0) {
builder.StartObject(2);
ContinueRequest.AddTargetAddress(builder, target_address);
ContinueRequest.AddAction(builder, action);
return ContinueRequest.EndContinueRequest(builder);
}
public static void StartContinueRequest(FlatBufferBuilder builder) { builder.StartObject(2); }
public static void AddAction(FlatBufferBuilder builder, ContinueAction action) { builder.AddSbyte(0, (sbyte)(action), 0); }
public static void AddTargetAddress(FlatBufferBuilder builder, uint targetAddress) { builder.AddUint(1, targetAddress, 0); }
public static int EndContinueRequest(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,22 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class ContinueResponse : Table {
public static ContinueResponse GetRootAsContinueResponse(ByteBuffer _bb) { return GetRootAsContinueResponse(_bb, new ContinueResponse()); }
public static ContinueResponse GetRootAsContinueResponse(ByteBuffer _bb, ContinueResponse obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public ContinueResponse __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public static void StartContinueResponse(FlatBufferBuilder builder) { builder.StartObject(0); }
public static int EndContinueResponse(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,31 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class GetModuleRequest : Table {
public static GetModuleRequest GetRootAsGetModuleRequest(ByteBuffer _bb) { return GetRootAsGetModuleRequest(_bb, new GetModuleRequest()); }
public static GetModuleRequest GetRootAsGetModuleRequest(ByteBuffer _bb, GetModuleRequest obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public GetModuleRequest __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public uint ModuleId { get { int o = __offset(4); return o != 0 ? bb.GetUint(o + bb_pos) : (uint)0; } }
public static int CreateGetModuleRequest(FlatBufferBuilder builder,
uint module_id = 0) {
builder.StartObject(1);
GetModuleRequest.AddModuleId(builder, module_id);
return GetModuleRequest.EndGetModuleRequest(builder);
}
public static void StartGetModuleRequest(FlatBufferBuilder builder) { builder.StartObject(1); }
public static void AddModuleId(FlatBufferBuilder builder, uint moduleId) { builder.AddUint(0, moduleId, 0); }
public static int EndGetModuleRequest(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,32 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class GetModuleResponse : Table {
public static GetModuleResponse GetRootAsGetModuleResponse(ByteBuffer _bb) { return GetRootAsGetModuleResponse(_bb, new GetModuleResponse()); }
public static GetModuleResponse GetRootAsGetModuleResponse(ByteBuffer _bb, GetModuleResponse obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public GetModuleResponse __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public Module Module { get { return GetModule(new Module()); } }
public Module GetModule(Module obj) { int o = __offset(4); return o != 0 ? obj.__init(__indirect(o + bb_pos), bb) : null; }
public static int CreateGetModuleResponse(FlatBufferBuilder builder,
int module = 0) {
builder.StartObject(1);
GetModuleResponse.AddModule(builder, module);
return GetModuleResponse.EndGetModuleResponse(builder);
}
public static void StartGetModuleResponse(FlatBufferBuilder builder) { builder.StartObject(1); }
public static void AddModule(FlatBufferBuilder builder, int moduleOffset) { builder.AddOffset(0, moduleOffset, 0); }
public static int EndGetModuleResponse(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -10,8 +10,20 @@ public sealed class ListBreakpointsResponse : Table {
public static ListBreakpointsResponse GetRootAsListBreakpointsResponse(ByteBuffer _bb, ListBreakpointsResponse obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public ListBreakpointsResponse __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public Breakpoint GetBreakpoints(int j) { return GetBreakpoints(new Breakpoint(), j); }
public Breakpoint GetBreakpoints(Breakpoint obj, int j) { int o = __offset(4); return o != 0 ? obj.__init(__vector(o) + j * 4, bb) : null; }
public int BreakpointsLength { get { int o = __offset(4); return o != 0 ? __vector_len(o) : 0; } }
public static void StartListBreakpointsResponse(FlatBufferBuilder builder) { builder.StartObject(0); }
public static int CreateListBreakpointsResponse(FlatBufferBuilder builder,
int breakpoints = 0) {
builder.StartObject(1);
ListBreakpointsResponse.AddBreakpoints(builder, breakpoints);
return ListBreakpointsResponse.EndListBreakpointsResponse(builder);
}
public static void StartListBreakpointsResponse(FlatBufferBuilder builder) { builder.StartObject(1); }
public static void AddBreakpoints(FlatBufferBuilder builder, int breakpointsOffset) { builder.AddOffset(0, breakpointsOffset, 0); }
public static void StartBreakpointsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
public static int EndListBreakpointsResponse(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;

View File

@@ -0,0 +1,22 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class ListModulesRequest : Table {
public static ListModulesRequest GetRootAsListModulesRequest(ByteBuffer _bb) { return GetRootAsListModulesRequest(_bb, new ListModulesRequest()); }
public static ListModulesRequest GetRootAsListModulesRequest(ByteBuffer _bb, ListModulesRequest obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public ListModulesRequest __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public static void StartListModulesRequest(FlatBufferBuilder builder) { builder.StartObject(0); }
public static int EndListModulesRequest(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,34 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class ListModulesResponse : Table {
public static ListModulesResponse GetRootAsListModulesResponse(ByteBuffer _bb) { return GetRootAsListModulesResponse(_bb, new ListModulesResponse()); }
public static ListModulesResponse GetRootAsListModulesResponse(ByteBuffer _bb, ListModulesResponse obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public ListModulesResponse __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public uint GetModuleIds(int j) { int o = __offset(4); return o != 0 ? bb.GetUint(__vector(o) + j * 4) : (uint)0; }
public int ModuleIdsLength { get { int o = __offset(4); return o != 0 ? __vector_len(o) : 0; } }
public static int CreateListModulesResponse(FlatBufferBuilder builder,
int module_ids = 0) {
builder.StartObject(1);
ListModulesResponse.AddModuleIds(builder, module_ids);
return ListModulesResponse.EndListModulesResponse(builder);
}
public static void StartListModulesResponse(FlatBufferBuilder builder) { builder.StartObject(1); }
public static void AddModuleIds(FlatBufferBuilder builder, int moduleIdsOffset) { builder.AddOffset(0, moduleIdsOffset, 0); }
public static int CreateModuleIdsVector(FlatBufferBuilder builder, uint[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddUint(data[i]); return builder.EndVector(); }
public static void StartModuleIdsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
public static int EndListModulesResponse(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,22 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class ListThreadsRequest : Table {
public static ListThreadsRequest GetRootAsListThreadsRequest(ByteBuffer _bb) { return GetRootAsListThreadsRequest(_bb, new ListThreadsRequest()); }
public static ListThreadsRequest GetRootAsListThreadsRequest(ByteBuffer _bb, ListThreadsRequest obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public ListThreadsRequest __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public static void StartListThreadsRequest(FlatBufferBuilder builder) { builder.StartObject(0); }
public static int EndListThreadsRequest(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,22 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class ListThreadsResponse : Table {
public static ListThreadsResponse GetRootAsListThreadsResponse(ByteBuffer _bb) { return GetRootAsListThreadsResponse(_bb, new ListThreadsResponse()); }
public static ListThreadsResponse GetRootAsListThreadsResponse(ByteBuffer _bb, ListThreadsResponse obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public ListThreadsResponse __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public static void StartListThreadsResponse(FlatBufferBuilder builder) { builder.StartObject(0); }
public static int EndListThreadsResponse(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,31 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class Module : Table {
public static Module GetRootAsModule(ByteBuffer _bb) { return GetRootAsModule(_bb, new Module()); }
public static Module GetRootAsModule(ByteBuffer _bb, Module obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public Module __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public XObject Object { get { return GetObject(new XObject()); } }
public XObject GetObject(XObject obj) { int o = __offset(4); return o != 0 ? obj.__init(o + bb_pos, bb) : null; }
public ModuleType Type { get { int o = __offset(6); return o != 0 ? (ModuleType)bb.GetSbyte(o + bb_pos) : (ModuleType)0; } }
public string Name { get { int o = __offset(8); return o != 0 ? __string(o + bb_pos) : null; } }
public string Path { get { int o = __offset(10); return o != 0 ? __string(o + bb_pos) : null; } }
public static void StartModule(FlatBufferBuilder builder) { builder.StartObject(4); }
public static void AddObject(FlatBufferBuilder builder, int objectOffset) { builder.AddStruct(0, objectOffset, 0); }
public static void AddType(FlatBufferBuilder builder, ModuleType type) { builder.AddSbyte(1, (sbyte)(type), 0); }
public static void AddName(FlatBufferBuilder builder, int nameOffset) { builder.AddOffset(2, nameOffset, 0); }
public static void AddPath(FlatBufferBuilder builder, int pathOffset) { builder.AddOffset(3, pathOffset, 0); }
public static int EndModule(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -3,10 +3,10 @@
namespace xe.debug.proto
{
public enum Foo : sbyte
public enum ModuleType : sbyte
{
A = 1,
B = 2,
Kernel = 0,
User = 1,
};

View File

@@ -1,22 +0,0 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class RemoveBreakpointRequest : Table {
public static RemoveBreakpointRequest GetRootAsRemoveBreakpointRequest(ByteBuffer _bb) { return GetRootAsRemoveBreakpointRequest(_bb, new RemoveBreakpointRequest()); }
public static RemoveBreakpointRequest GetRootAsRemoveBreakpointRequest(ByteBuffer _bb, RemoveBreakpointRequest obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public RemoveBreakpointRequest __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public static void StartRemoveBreakpointRequest(FlatBufferBuilder builder) { builder.StartObject(0); }
public static int EndRemoveBreakpointRequest(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -1,22 +0,0 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class RemoveBreakpointResponse : Table {
public static RemoveBreakpointResponse GetRootAsRemoveBreakpointResponse(ByteBuffer _bb) { return GetRootAsRemoveBreakpointResponse(_bb, new RemoveBreakpointResponse()); }
public static RemoveBreakpointResponse GetRootAsRemoveBreakpointResponse(ByteBuffer _bb, RemoveBreakpointResponse obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public RemoveBreakpointResponse __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public static void StartRemoveBreakpointResponse(FlatBufferBuilder builder) { builder.StartObject(0); }
public static int EndRemoveBreakpointResponse(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,34 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class RemoveBreakpointsRequest : Table {
public static RemoveBreakpointsRequest GetRootAsRemoveBreakpointsRequest(ByteBuffer _bb) { return GetRootAsRemoveBreakpointsRequest(_bb, new RemoveBreakpointsRequest()); }
public static RemoveBreakpointsRequest GetRootAsRemoveBreakpointsRequest(ByteBuffer _bb, RemoveBreakpointsRequest obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public RemoveBreakpointsRequest __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public Breakpoint GetBreakpoints(int j) { return GetBreakpoints(new Breakpoint(), j); }
public Breakpoint GetBreakpoints(Breakpoint obj, int j) { int o = __offset(4); return o != 0 ? obj.__init(__vector(o) + j * 4, bb) : null; }
public int BreakpointsLength { get { int o = __offset(4); return o != 0 ? __vector_len(o) : 0; } }
public static int CreateRemoveBreakpointsRequest(FlatBufferBuilder builder,
int breakpoints = 0) {
builder.StartObject(1);
RemoveBreakpointsRequest.AddBreakpoints(builder, breakpoints);
return RemoveBreakpointsRequest.EndRemoveBreakpointsRequest(builder);
}
public static void StartRemoveBreakpointsRequest(FlatBufferBuilder builder) { builder.StartObject(1); }
public static void AddBreakpoints(FlatBufferBuilder builder, int breakpointsOffset) { builder.AddOffset(0, breakpointsOffset, 0); }
public static void StartBreakpointsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
public static int EndRemoveBreakpointsRequest(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,22 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class RemoveBreakpointsResponse : Table {
public static RemoveBreakpointsResponse GetRootAsRemoveBreakpointsResponse(ByteBuffer _bb) { return GetRootAsRemoveBreakpointsResponse(_bb, new RemoveBreakpointsResponse()); }
public static RemoveBreakpointsResponse GetRootAsRemoveBreakpointsResponse(ByteBuffer _bb, RemoveBreakpointsResponse obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public RemoveBreakpointsResponse __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public static void StartRemoveBreakpointsResponse(FlatBufferBuilder builder) { builder.StartObject(0); }
public static int EndRemoveBreakpointsResponse(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -8,9 +8,15 @@ public enum RequestData : byte
NONE = 0,
AttachRequest = 1,
ListBreakpointsRequest = 2,
AddBreakpointRequest = 3,
UpdateBreakpointRequest = 4,
RemoveBreakpointRequest = 5,
AddBreakpointsRequest = 3,
UpdateBreakpointsRequest = 4,
RemoveBreakpointsRequest = 5,
ListModulesRequest = 6,
GetModuleRequest = 7,
StopRequest = 8,
BreakRequest = 9,
ContinueRequest = 10,
StepRequest = 11,
};

View File

@@ -8,9 +8,17 @@ public enum ResponseData : byte
NONE = 0,
AttachResponse = 1,
ListBreakpointsResponse = 2,
AddBreakpointResponse = 3,
UpdateBreakpointResponse = 4,
RemoveBreakpointResponse = 5,
AddBreakpointsResponse = 3,
UpdateBreakpointsResponse = 4,
RemoveBreakpointsResponse = 5,
ListModulesResponse = 6,
GetModuleResponse = 7,
StopResponse = 8,
BreakResponse = 9,
ContinueResponse = 10,
StepResponse = 11,
BreakpointEvent = 12,
AccessViolationEvent = 13,
};

View File

@@ -0,0 +1,14 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
public enum StepAction : sbyte
{
StepIn = 0,
StepOver = 1,
StepOut = 2,
};
}

View File

@@ -0,0 +1,35 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class StepRequest : Table {
public static StepRequest GetRootAsStepRequest(ByteBuffer _bb) { return GetRootAsStepRequest(_bb, new StepRequest()); }
public static StepRequest GetRootAsStepRequest(ByteBuffer _bb, StepRequest obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public StepRequest __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public StepAction Action { get { int o = __offset(4); return o != 0 ? (StepAction)bb.GetSbyte(o + bb_pos) : (StepAction)0; } }
public uint ThreadId { get { int o = __offset(6); return o != 0 ? bb.GetUint(o + bb_pos) : (uint)0; } }
public static int CreateStepRequest(FlatBufferBuilder builder,
StepAction action = 0,
uint thread_id = 0) {
builder.StartObject(2);
StepRequest.AddThreadId(builder, thread_id);
StepRequest.AddAction(builder, action);
return StepRequest.EndStepRequest(builder);
}
public static void StartStepRequest(FlatBufferBuilder builder) { builder.StartObject(2); }
public static void AddAction(FlatBufferBuilder builder, StepAction action) { builder.AddSbyte(0, (sbyte)(action), 0); }
public static void AddThreadId(FlatBufferBuilder builder, uint threadId) { builder.AddUint(1, threadId, 0); }
public static int EndStepRequest(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,22 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class StepResponse : Table {
public static StepResponse GetRootAsStepResponse(ByteBuffer _bb) { return GetRootAsStepResponse(_bb, new StepResponse()); }
public static StepResponse GetRootAsStepResponse(ByteBuffer _bb, StepResponse obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public StepResponse __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public static void StartStepResponse(FlatBufferBuilder builder) { builder.StartObject(0); }
public static int EndStepResponse(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,22 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class StopRequest : Table {
public static StopRequest GetRootAsStopRequest(ByteBuffer _bb) { return GetRootAsStopRequest(_bb, new StopRequest()); }
public static StopRequest GetRootAsStopRequest(ByteBuffer _bb, StopRequest obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public StopRequest __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public static void StartStopRequest(FlatBufferBuilder builder) { builder.StartObject(0); }
public static int EndStopRequest(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,22 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class StopResponse : Table {
public static StopResponse GetRootAsStopResponse(ByteBuffer _bb) { return GetRootAsStopResponse(_bb, new StopResponse()); }
public static StopResponse GetRootAsStopResponse(ByteBuffer _bb, StopResponse obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public StopResponse __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public static void StartStopResponse(FlatBufferBuilder builder) { builder.StartObject(0); }
public static int EndStopResponse(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -1,25 +0,0 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class StructTest : Struct {
public StructTest __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public short A { get { return bb.GetShort(bb_pos + 0); } }
public sbyte B { get { return bb.GetSbyte(bb_pos + 2); } }
public Foo C { get { return (Foo)bb.GetSbyte(bb_pos + 3); } }
public static int CreateStructTest(FlatBufferBuilder builder, short A, sbyte B, Foo C) {
builder.Prep(2, 4);
builder.PutSbyte((sbyte)(C));
builder.PutSbyte(B);
builder.PutShort(A);
return builder.Offset;
}
};
}

View File

@@ -1,35 +0,0 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class TableTest : Table {
public static TableTest GetRootAsTableTest(ByteBuffer _bb) { return GetRootAsTableTest(_bb, new TableTest()); }
public static TableTest GetRootAsTableTest(ByteBuffer _bb, TableTest obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public TableTest __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public StructTest St { get { return GetSt(new StructTest()); } }
public StructTest GetSt(StructTest obj) { int o = __offset(4); return o != 0 ? obj.__init(o + bb_pos, bb) : null; }
public byte GetIv(int j) { int o = __offset(6); return o != 0 ? bb.Get(__vector(o) + j * 1) : (byte)0; }
public int IvLength { get { int o = __offset(6); return o != 0 ? __vector_len(o) : 0; } }
public string Name { get { int o = __offset(8); return o != 0 ? __string(o + bb_pos) : null; } }
public uint Id { get { int o = __offset(10); return o != 0 ? bb.GetUint(o + bb_pos) : (uint)0; } }
public static void StartTableTest(FlatBufferBuilder builder) { builder.StartObject(4); }
public static void AddSt(FlatBufferBuilder builder, int stOffset) { builder.AddStruct(0, stOffset, 0); }
public static void AddIv(FlatBufferBuilder builder, int ivOffset) { builder.AddOffset(1, ivOffset, 0); }
public static int CreateIvVector(FlatBufferBuilder builder, byte[] data) { builder.StartVector(1, data.Length, 1); for (int i = data.Length - 1; i >= 0; i--) builder.AddByte(data[i]); return builder.EndVector(); }
public static void StartIvVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(1, numElems, 1); }
public static void AddName(FlatBufferBuilder builder, int nameOffset) { builder.AddOffset(2, nameOffset, 0); }
public static void AddId(FlatBufferBuilder builder, uint id) { builder.AddUint(3, id, 0); }
public static int EndTableTest(FlatBufferBuilder builder) {
int o = builder.EndObject();
builder.Required(o, 8); // name
return o;
}
};
}

View File

@@ -0,0 +1,27 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class Thread : Table {
public static Thread GetRootAsThread(ByteBuffer _bb) { return GetRootAsThread(_bb, new Thread()); }
public static Thread GetRootAsThread(ByteBuffer _bb, Thread obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public Thread __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public XObject Object { get { return GetObject(new XObject()); } }
public XObject GetObject(XObject obj) { int o = __offset(4); return o != 0 ? obj.__init(o + bb_pos, bb) : null; }
public ThreadType Type { get { int o = __offset(6); return o != 0 ? (ThreadType)bb.GetSbyte(o + bb_pos) : (ThreadType)0; } }
public static void StartThread(FlatBufferBuilder builder) { builder.StartObject(2); }
public static void AddObject(FlatBufferBuilder builder, int objectOffset) { builder.AddStruct(0, objectOffset, 0); }
public static void AddType(FlatBufferBuilder builder, ThreadType type) { builder.AddSbyte(1, (sbyte)(type), 0); }
public static int EndThread(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,13 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
public enum ThreadType : sbyte
{
Kernel = 0,
User = 1,
};
}

View File

@@ -1,22 +0,0 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class UpdateBreakpointRequest : Table {
public static UpdateBreakpointRequest GetRootAsUpdateBreakpointRequest(ByteBuffer _bb) { return GetRootAsUpdateBreakpointRequest(_bb, new UpdateBreakpointRequest()); }
public static UpdateBreakpointRequest GetRootAsUpdateBreakpointRequest(ByteBuffer _bb, UpdateBreakpointRequest obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public UpdateBreakpointRequest __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public static void StartUpdateBreakpointRequest(FlatBufferBuilder builder) { builder.StartObject(0); }
public static int EndUpdateBreakpointRequest(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -1,22 +0,0 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class UpdateBreakpointResponse : Table {
public static UpdateBreakpointResponse GetRootAsUpdateBreakpointResponse(ByteBuffer _bb) { return GetRootAsUpdateBreakpointResponse(_bb, new UpdateBreakpointResponse()); }
public static UpdateBreakpointResponse GetRootAsUpdateBreakpointResponse(ByteBuffer _bb, UpdateBreakpointResponse obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public UpdateBreakpointResponse __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public static void StartUpdateBreakpointResponse(FlatBufferBuilder builder) { builder.StartObject(0); }
public static int EndUpdateBreakpointResponse(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,34 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class UpdateBreakpointsRequest : Table {
public static UpdateBreakpointsRequest GetRootAsUpdateBreakpointsRequest(ByteBuffer _bb) { return GetRootAsUpdateBreakpointsRequest(_bb, new UpdateBreakpointsRequest()); }
public static UpdateBreakpointsRequest GetRootAsUpdateBreakpointsRequest(ByteBuffer _bb, UpdateBreakpointsRequest obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public UpdateBreakpointsRequest __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public Breakpoint GetBreakpoints(int j) { return GetBreakpoints(new Breakpoint(), j); }
public Breakpoint GetBreakpoints(Breakpoint obj, int j) { int o = __offset(4); return o != 0 ? obj.__init(__vector(o) + j * 4, bb) : null; }
public int BreakpointsLength { get { int o = __offset(4); return o != 0 ? __vector_len(o) : 0; } }
public static int CreateUpdateBreakpointsRequest(FlatBufferBuilder builder,
int breakpoints = 0) {
builder.StartObject(1);
UpdateBreakpointsRequest.AddBreakpoints(builder, breakpoints);
return UpdateBreakpointsRequest.EndUpdateBreakpointsRequest(builder);
}
public static void StartUpdateBreakpointsRequest(FlatBufferBuilder builder) { builder.StartObject(1); }
public static void AddBreakpoints(FlatBufferBuilder builder, int breakpointsOffset) { builder.AddOffset(0, breakpointsOffset, 0); }
public static void StartBreakpointsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
public static int EndUpdateBreakpointsRequest(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,22 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class UpdateBreakpointsResponse : Table {
public static UpdateBreakpointsResponse GetRootAsUpdateBreakpointsResponse(ByteBuffer _bb) { return GetRootAsUpdateBreakpointsResponse(_bb, new UpdateBreakpointsResponse()); }
public static UpdateBreakpointsResponse GetRootAsUpdateBreakpointsResponse(ByteBuffer _bb, UpdateBreakpointsResponse obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public UpdateBreakpointsResponse __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public static void StartUpdateBreakpointsResponse(FlatBufferBuilder builder) { builder.StartObject(0); }
public static int EndUpdateBreakpointsResponse(FlatBufferBuilder builder) {
int o = builder.EndObject();
return o;
}
};
}

View File

@@ -0,0 +1,21 @@
// automatically generated, do not modify
namespace xe.debug.proto
{
using FlatBuffers;
public sealed class XObject : Struct {
public XObject __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public uint Handle { get { return bb.GetUint(bb_pos + 0); } }
public static int CreateXObject(FlatBufferBuilder builder, uint Handle) {
builder.Prep(4, 4);
builder.PutUint(Handle);
return builder.Offset;
}
};
}

View File

@@ -7,8 +7,39 @@ using Xenia.Debug.Utilities;
namespace Xenia.Debug {
public class ThreadContext {
// Maps to ppc_context.h:
// r[32]
// f[32]
// v[128]
// lr
// ctr
// xer
// crN?
// fpscr
}
public class Thread : Changeable {
public class Thread : KernelObject {
// xobject: handle
// module?
// pcr address
// thread state address
// tls address
// stack address, size
// thread id
// name
// IsAlive
// priority
// affinity
// state: running, suspended, waiting
// creation params:
// stack size
// xapi thread startup fn
// start address fn
// start context
// creation flags
// callstack at creation
public Thread(Debugger debugger, uint threadHandle) : base(debugger, threadHandle) {
}
}
}

View File

@@ -63,29 +63,53 @@
<Compile Include="Breakpoint.cs" />
<Compile Include="BreakpointList.cs" />
<Compile Include="Callstack.cs" />
<Compile Include="Context.cs" />
<Compile Include="Debugger.cs" />
<Compile Include="Function.cs" />
<Compile Include="FunctionList.cs" />
<Compile Include="KernelObject.cs" />
<Compile Include="Memory.cs" />
<Compile Include="MemoryView.cs" />
<Compile Include="Module.cs" />
<Compile Include="ModuleList.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Proto\xe\debug\proto\AddBreakpointRequest.cs" />
<Compile Include="Proto\xe\debug\proto\AddBreakpointResponse.cs" />
<Compile Include="Proto\xe\debug\proto\AccessViolationEvent.cs" />
<Compile Include="Proto\xe\debug\proto\AddBreakpointsRequest.cs" />
<Compile Include="Proto\xe\debug\proto\AddBreakpointsResponse.cs" />
<Compile Include="Proto\xe\debug\proto\AttachRequest.cs" />
<Compile Include="Proto\xe\debug\proto\AttachResponse.cs" />
<Compile Include="Proto\xe\debug\proto\Foo.cs" />
<Compile Include="Proto\xe\debug\proto\Breakpoint.cs" />
<Compile Include="Proto\xe\debug\proto\BreakpointEvent.cs" />
<Compile Include="Proto\xe\debug\proto\BreakRequest.cs" />
<Compile Include="Proto\xe\debug\proto\BreakResponse.cs" />
<Compile Include="Proto\xe\debug\proto\ContinueAction.cs" />
<Compile Include="Proto\xe\debug\proto\ContinueRequest.cs" />
<Compile Include="Proto\xe\debug\proto\ContinueResponse.cs" />
<Compile Include="Proto\xe\debug\proto\GetModuleRequest.cs" />
<Compile Include="Proto\xe\debug\proto\GetModuleResponse.cs" />
<Compile Include="Proto\xe\debug\proto\ListBreakpointsRequest.cs" />
<Compile Include="Proto\xe\debug\proto\ListBreakpointsResponse.cs" />
<Compile Include="Proto\xe\debug\proto\RemoveBreakpointRequest.cs" />
<Compile Include="Proto\xe\debug\proto\RemoveBreakpointResponse.cs" />
<Compile Include="Proto\xe\debug\proto\ListModulesRequest.cs" />
<Compile Include="Proto\xe\debug\proto\ListModulesResponse.cs" />
<Compile Include="Proto\xe\debug\proto\ListThreadsRequest.cs" />
<Compile Include="Proto\xe\debug\proto\ListThreadsResponse.cs" />
<Compile Include="Proto\xe\debug\proto\Module.cs" />
<Compile Include="Proto\xe\debug\proto\ModuleType.cs" />
<Compile Include="Proto\xe\debug\proto\RemoveBreakpointsRequest.cs" />
<Compile Include="Proto\xe\debug\proto\RemoveBreakpointsResponse.cs" />
<Compile Include="Proto\xe\debug\proto\Request.cs" />
<Compile Include="Proto\xe\debug\proto\RequestData.cs" />
<Compile Include="Proto\xe\debug\proto\Response.cs" />
<Compile Include="Proto\xe\debug\proto\ResponseData.cs" />
<Compile Include="Proto\xe\debug\proto\StructTest.cs" />
<Compile Include="Proto\xe\debug\proto\TableTest.cs" />
<Compile Include="Proto\xe\debug\proto\StepAction.cs" />
<Compile Include="Proto\xe\debug\proto\StepRequest.cs" />
<Compile Include="Proto\xe\debug\proto\StepResponse.cs" />
<Compile Include="Proto\xe\debug\proto\StopRequest.cs" />
<Compile Include="Proto\xe\debug\proto\StopResponse.cs" />
<Compile Include="Proto\xe\debug\proto\Thread.cs" />
<Compile Include="Proto\xe\debug\proto\ThreadType.cs" />
<Compile Include="Proto\xe\debug\proto\UpdateBreakpointsRequest.cs" />
<Compile Include="Proto\xe\debug\proto\UpdateBreakpointsResponse.cs" />
<Compile Include="Proto\xe\debug\proto\XObject.cs" />
<Compile Include="Thread.cs" />
<Compile Include="ThreadList.cs" />
<Compile Include="Utilities\Changeable.cs" />