2016-02-21 22:34:14 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace BizHawk.Emulation.Common
|
2014-12-05 00:17:34 +00:00
|
|
|
|
{
|
2016-08-13 20:31:04 +00:00
|
|
|
|
public interface ITraceSink
|
|
|
|
|
{
|
|
|
|
|
void Put(TraceInfo info);
|
|
|
|
|
}
|
|
|
|
|
|
2014-12-05 00:17:34 +00:00
|
|
|
|
/// <summary>
|
2016-03-02 02:10:09 +00:00
|
|
|
|
/// This service allows the core to dump a cpu trace to the client
|
|
|
|
|
/// If available the Trace Logger tool will be available on the client
|
2014-12-05 00:17:34 +00:00
|
|
|
|
/// </summary>
|
2014-12-23 01:58:12 +00:00
|
|
|
|
public interface ITraceable : IEmulatorService
|
2014-12-05 00:17:34 +00:00
|
|
|
|
{
|
2016-08-13 20:31:04 +00:00
|
|
|
|
//bool Enabled { get; set; }
|
2014-12-05 00:17:34 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The header that would be used by a trace logger
|
|
|
|
|
/// </summary>
|
|
|
|
|
string Header { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The current log of cpu instructions
|
|
|
|
|
/// </summary>
|
2016-08-13 20:31:04 +00:00
|
|
|
|
//IEnumerable<TraceInfo> Contents { get; }
|
2014-12-05 00:17:34 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Takes the current log of cpu instructions, when doing so, it will clear the contents from the buffer
|
|
|
|
|
/// </summary>
|
2016-08-13 20:31:04 +00:00
|
|
|
|
//IEnumerable<TraceInfo> TakeContents();
|
|
|
|
|
|
|
|
|
|
//void Put(TraceInfo content);
|
|
|
|
|
|
|
|
|
|
//that's right, we can only have one sink.
|
|
|
|
|
//a sink can route to two other sinks if it has to, though
|
|
|
|
|
ITraceSink Sink { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// This is defined as equivalent to Sink != null
|
|
|
|
|
/// It's put here because it's such a common operation to check whether it's enabled, and it's not nice to write Sink != null all over
|
|
|
|
|
/// </summary>
|
|
|
|
|
bool Enabled { get; }
|
2014-12-05 00:17:34 +00:00
|
|
|
|
|
2016-08-13 20:31:04 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// This is defined as equivalent to Sink.Put
|
|
|
|
|
/// TBD: could it be defined as equivalent to if(Enabled) Sink.Put()? Probably not, that's just a small amount of wasted work
|
|
|
|
|
/// </summary>
|
|
|
|
|
void Put(TraceInfo info);
|
2016-02-21 22:34:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class TraceInfo
|
|
|
|
|
{
|
|
|
|
|
public string Disassembly { get; set; }
|
|
|
|
|
public string RegisterInfo { get; set; }
|
2014-12-05 00:17:34 +00:00
|
|
|
|
}
|
|
|
|
|
}
|