Trace Logger (very basic, not finished)

This commit is contained in:
Souryo 2016-01-10 19:56:40 -05:00
parent 9658597e9f
commit 3b73bb8f83
20 changed files with 445 additions and 54 deletions

View file

@ -270,6 +270,7 @@
<ClInclude Include="Bandai74161_7432.h" />
<ClInclude Include="BF909x.h" />
<ClInclude Include="BnRom.h" />
<ClInclude Include="DebugState.h" />
<ClInclude Include="DefaultVideoFilter.h" />
<ClInclude Include="ExpressionEvaluator.h" />
<ClInclude Include="HdVideoFilter.h" />
@ -357,6 +358,7 @@
<ClInclude Include="Sunsoft93.h" />
<ClInclude Include="TaitoTc0190.h" />
<ClInclude Include="TaitoX1005.h" />
<ClInclude Include="TraceLogger.h" />
<ClInclude Include="TriangleChannel.h" />
<ClInclude Include="UnlPci556.h" />
<ClInclude Include="UNROM.h" />
@ -404,6 +406,7 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release x64|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release x64|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="TraceLogger.cpp" />
<ClCompile Include="VideoDecoder.cpp" />
<ClCompile Include="BaseVideoFilter.cpp" />
<ClCompile Include="VirtualController.cpp" />

View file

@ -335,6 +335,12 @@
<ClInclude Include="ExpressionEvaluator.h">
<Filter>Debugger</Filter>
</ClInclude>
<ClInclude Include="TraceLogger.h">
<Filter>Debugger</Filter>
</ClInclude>
<ClInclude Include="DebugState.h">
<Filter>Debugger</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
@ -442,5 +448,8 @@
<ClCompile Include="ExpressionEvaluator.cpp">
<Filter>Debugger</Filter>
</ClCompile>
<ClCompile Include="TraceLogger.cpp">
<Filter>Debugger</Filter>
</ClCompile>
</ItemGroup>
</Project>

10
Core/DebugState.h Normal file
View file

@ -0,0 +1,10 @@
#pragma once
#include "stdafx.h"
#include "CPU.h"
#include "PPU.h"
struct DebugState
{
State CPU;
PPUDebugState PPU;
};

View file

@ -230,6 +230,12 @@ void Debugger::PrivateProcessRamOperation(MemoryOperationType type, uint16_t &ad
_disassembler->BuildCache(absoluteAddr, addr);
_lastInstruction = _memoryManager->DebugRead(addr);
if(_traceLogger) {
DebugState state;
GetState(&state);
_traceLogger->Log(state, _disassembler->GetDisassemblyInfo(absoluteAddr));
}
UpdateCallstack(addr);
ProcessStepConditions(addr);
@ -414,6 +420,17 @@ void Debugger::SetNextStatement(uint16_t addr)
}
}
void Debugger::StartTraceLogger(TraceLoggerOptions options)
{
string traceFilepath = FolderUtilities::CombinePath(FolderUtilities::GetDebuggerFolder(), "Trace.txt");
_traceLogger.reset(new TraceLogger(traceFilepath, options));
}
void Debugger::StopTraceLogger()
{
_traceLogger.release();
}
void Debugger::ProcessPpuCycle()
{
if(Debugger::Instance) {

View file

@ -8,7 +8,9 @@ using std::deque;
#include "CPU.h"
#include "PPU.h"
#include "DebugState.h"
#include "Breakpoint.h"
#include "TraceLogger.h"
#include "../Utilities/SimpleLock.h"
#include "CodeDataLogger.h"
@ -16,12 +18,6 @@ class MemoryManager;
class Console;
class Disassembler;
struct DebugState
{
State CPU;
PPUDebugState PPU;
};
enum class DebugMemoryType
{
CpuMemory = 0,
@ -59,6 +55,8 @@ private:
SimpleLock _bpLock;
SimpleLock _breakLock;
unique_ptr<TraceLogger> _traceLogger;
uint16_t *_currentReadAddr; //Used to alter the executing address via "Set Next Statement"
string _romFilepath;
@ -115,6 +113,9 @@ public:
uint8_t GetMemoryValue(uint32_t addr);
uint32_t GetRelativeAddress(uint32_t addr);
void StartTraceLogger(TraceLoggerOptions options);
void StopTraceLogger();
int32_t EvaluateExpression(string expression, EvalResultType &resultType);
static void ProcessRamOperation(MemoryOperationType type, uint16_t &addr, uint8_t value);

View file

@ -192,3 +192,8 @@ string Disassembler::GetCode(uint32_t startAddr, uint32_t endAddr, uint16_t &mem
return output.str();
}
shared_ptr<DisassemblyInfo> Disassembler::GetDisassemblyInfo(uint32_t address)
{
return _disassembleCache[address];
}

View file

@ -20,4 +20,6 @@ public:
uint32_t BuildCache(uint32_t absoluteAddr, uint16_t memoryAddr);
string GetRAMCode();
string GetCode(uint32_t startAddr, uint32_t endAddr, uint16_t &memoryAddr);
shared_ptr<DisassemblyInfo> GetDisassemblyInfo(uint32_t address);
};

View file

@ -18,9 +18,12 @@ void DisassemblyInfo::Initialize(uint32_t memoryAddr)
//Output raw byte code
for(uint32_t i = 0; i < 3; i++) {
if(i < _opSize) {
output << "$" << std::hex << std::uppercase << std::setfill('0') << std::setw(2) << (short)*(_opPointer+i) << " ";
output << "$" << std::hex << std::uppercase << std::setfill('0') << std::setw(2) << (short)*(_opPointer + i);
} else {
output << " ";
output << " ";
}
if(i != 2) {
output << " ";
}
}
output << ":";

View file

@ -1,7 +1,7 @@
#include "stdafx.h"
#include "EmulationSettings.h"
uint32_t EmulationSettings::_flags = 0;
uint32_t EmulationSettings::_flags = EmulationFlags::LowLatency;
bool EmulationSettings::_audioEnabled = true;
uint32_t EmulationSettings::_audioLatency = 20000;

View file

@ -8,6 +8,7 @@ enum EmulationFlags
Paused = 0x01,
ShowFPS = 0x02,
VerticalSync = 0x04,
LowLatency = 0x08,
Mmc3IrqAltBehavior = 0x8000,
};

33
Core/TraceLogger.cpp Normal file
View file

@ -0,0 +1,33 @@
#include "stdafx.h"
#include "TraceLogger.h"
#include "DisassemblyInfo.h"
#include "DebugState.h"
TraceLogger::TraceLogger(string outputFilepath, TraceLoggerOptions options)
{
_outputFile.open(outputFilepath, ios::out | ios::binary);
_options = options;
}
TraceLogger::~TraceLogger()
{
if(_outputFile) {
_outputFile.close();
}
}
void TraceLogger::Log(DebugState &state, shared_ptr<DisassemblyInfo> disassemblyInfo)
{
State &cpuState = state.CPU;
PPUDebugState &ppuState = state.PPU;
string disassembly = disassemblyInfo->ToString(cpuState.DebugPC);
while(disassembly.size() < 30) {
disassembly += " ";
}
_outputFile << std::uppercase << std::hex << (short)cpuState.DebugPC << ": " << disassembly << " "
<< "A:" << (short)cpuState.A << " X:" << (short)cpuState.X << " Y:" << (short)cpuState.Y << " P:" << (short)cpuState.PS << " SP:" << (short)cpuState.SP
<< std::dec
<< " CYC:" << (short)ppuState.Cycle << " SL:" << (short)ppuState.Scanline << std::endl;
}

23
Core/TraceLogger.h Normal file
View file

@ -0,0 +1,23 @@
#pragma once
#include "stdafx.h"
#include "DebugState.h"
#include "DisassemblyInfo.h"
struct TraceLoggerOptions
{
};
class TraceLogger
{
private:
TraceLoggerOptions _options;
string _outputFilepath;
ofstream _outputFile;
public:
TraceLogger(string outputFilepath, TraceLoggerOptions options);
~TraceLogger();
void Log(DebugState &state, shared_ptr<DisassemblyInfo> disassemblyInfo);
};

View file

@ -73,6 +73,10 @@
this.mnuFindNext = new System.Windows.Forms.ToolStripMenuItem();
this.mnuFindPrev = new System.Windows.Forms.ToolStripMenuItem();
this.mnuGoTo = new System.Windows.Forms.ToolStripMenuItem();
this.mnuGoToAddress = new System.Windows.Forms.ToolStripMenuItem();
this.mnuGoToIrqHandler = new System.Windows.Forms.ToolStripMenuItem();
this.mnuGoToNmiHandler = new System.Windows.Forms.ToolStripMenuItem();
this.mnuGoToResetHandler = new System.Windows.Forms.ToolStripMenuItem();
this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mnuPpuViewer = new System.Windows.Forms.ToolStripMenuItem();
this.mnuMemoryViewer = new System.Windows.Forms.ToolStripMenuItem();
@ -85,16 +89,14 @@
this.generateROMToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveStrippedDataToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveUnusedDataToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mnuTraceLogger = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripMenuItem();
this.statusStrip = new System.Windows.Forms.StatusStrip();
this.lblPrgAnalysis = new System.Windows.Forms.ToolStripStatusLabel();
this.lblPrgAnalysisResult = new System.Windows.Forms.ToolStripStatusLabel();
this.lblChrAnalysis = new System.Windows.Forms.ToolStripStatusLabel();
this.lblChrAnalysisResult = new System.Windows.Forms.ToolStripStatusLabel();
this.tmrCdlRatios = new System.Windows.Forms.Timer(this.components);
this.mnuGoToAddress = new System.Windows.Forms.ToolStripMenuItem();
this.mnuGoToIrqHandler = new System.Windows.Forms.ToolStripMenuItem();
this.mnuGoToNmiHandler = new System.Windows.Forms.ToolStripMenuItem();
this.mnuGoToResetHandler = new System.Windows.Forms.ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
this.splitContainer.Panel1.SuspendLayout();
this.splitContainer.Panel2.SuspendLayout();
@ -308,12 +310,12 @@
// toolStripMenuItem3
//
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(149, 6);
this.toolStripMenuItem3.Size = new System.Drawing.Size(100, 6);
//
// mnuClose
//
this.mnuClose.Name = "mnuClose";
this.mnuClose.Size = new System.Drawing.Size(152, 22);
this.mnuClose.Size = new System.Drawing.Size(103, 22);
this.mnuClose.Text = "Close";
this.mnuClose.Click += new System.EventHandler(this.mnuClose_Click);
//
@ -330,7 +332,7 @@
//
this.mnuSplitView.CheckOnClick = true;
this.mnuSplitView.Name = "mnuSplitView";
this.mnuSplitView.Size = new System.Drawing.Size(152, 22);
this.mnuSplitView.Size = new System.Drawing.Size(125, 22);
this.mnuSplitView.Text = "Split View";
this.mnuSplitView.Click += new System.EventHandler(this.mnuSplitView_Click);
//
@ -341,7 +343,7 @@
this.mnuDecreaseFontSize,
this.mnuResetFontSize});
this.fontSizeToolStripMenuItem.Name = "fontSizeToolStripMenuItem";
this.fontSizeToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.fontSizeToolStripMenuItem.Size = new System.Drawing.Size(125, 22);
this.fontSizeToolStripMenuItem.Text = "Text Size";
//
// mnuIncreaseFontSize
@ -510,12 +512,42 @@
this.mnuGoTo.Size = new System.Drawing.Size(196, 22);
this.mnuGoTo.Text = "Go To...";
//
// mnuGoToAddress
//
this.mnuGoToAddress.Name = "mnuGoToAddress";
this.mnuGoToAddress.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.G)));
this.mnuGoToAddress.Size = new System.Drawing.Size(158, 22);
this.mnuGoToAddress.Text = "Address";
this.mnuGoToAddress.Click += new System.EventHandler(this.mnuGoToAddress_Click);
//
// mnuGoToIrqHandler
//
this.mnuGoToIrqHandler.Name = "mnuGoToIrqHandler";
this.mnuGoToIrqHandler.Size = new System.Drawing.Size(158, 22);
this.mnuGoToIrqHandler.Text = "IRQ Handler";
this.mnuGoToIrqHandler.Click += new System.EventHandler(this.mnuGoToIrqHandler_Click);
//
// mnuGoToNmiHandler
//
this.mnuGoToNmiHandler.Name = "mnuGoToNmiHandler";
this.mnuGoToNmiHandler.Size = new System.Drawing.Size(158, 22);
this.mnuGoToNmiHandler.Text = "NMI Handler";
this.mnuGoToNmiHandler.Click += new System.EventHandler(this.mnuGoToNmiHandler_Click);
//
// mnuGoToResetHandler
//
this.mnuGoToResetHandler.Name = "mnuGoToResetHandler";
this.mnuGoToResetHandler.Size = new System.Drawing.Size(158, 22);
this.mnuGoToResetHandler.Text = "Reset Handler";
this.mnuGoToResetHandler.Click += new System.EventHandler(this.mnuGoToResetHandler_Click);
//
// toolsToolStripMenuItem
//
this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mnuPpuViewer,
this.mnuMemoryViewer,
this.mnuCodeDataLogger});
this.mnuCodeDataLogger,
this.mnuTraceLogger});
this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
this.toolsToolStripMenuItem.Size = new System.Drawing.Size(48, 20);
this.toolsToolStripMenuItem.Text = "Tools";
@ -604,6 +636,20 @@
this.saveUnusedDataToolStripMenuItem.Size = new System.Drawing.Size(170, 22);
this.saveUnusedDataToolStripMenuItem.Text = "Save unused data";
//
// mnuTraceLogger
//
this.mnuTraceLogger.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripMenuItem5});
this.mnuTraceLogger.Name = "mnuTraceLogger";
this.mnuTraceLogger.Size = new System.Drawing.Size(171, 22);
this.mnuTraceLogger.Text = "Trace Logger";
this.mnuTraceLogger.Click += new System.EventHandler(this.mnuTraceLogger_Click);
//
// toolStripMenuItem5
//
this.toolStripMenuItem5.Name = "toolStripMenuItem5";
this.toolStripMenuItem5.Size = new System.Drawing.Size(152, 22);
//
// statusStrip
//
this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -649,35 +695,6 @@
this.tmrCdlRatios.Interval = 300;
this.tmrCdlRatios.Tick += new System.EventHandler(this.tmrCdlRatios_Tick);
//
// mnuGoToAddress
//
this.mnuGoToAddress.Name = "mnuGoToAddress";
this.mnuGoToAddress.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.G)));
this.mnuGoToAddress.Size = new System.Drawing.Size(158, 22);
this.mnuGoToAddress.Text = "Address";
this.mnuGoToAddress.Click += new System.EventHandler(this.mnuGoToAddress_Click);
//
// mnuGoToIrqHandler
//
this.mnuGoToIrqHandler.Name = "mnuGoToIrqHandler";
this.mnuGoToIrqHandler.Size = new System.Drawing.Size(158, 22);
this.mnuGoToIrqHandler.Text = "IRQ Handler";
this.mnuGoToIrqHandler.Click += new System.EventHandler(this.mnuGoToIrqHandler_Click);
//
// mnuGoToNmiHandler
//
this.mnuGoToNmiHandler.Name = "mnuGoToNmiHandler";
this.mnuGoToNmiHandler.Size = new System.Drawing.Size(158, 22);
this.mnuGoToNmiHandler.Text = "NMI Handler";
this.mnuGoToNmiHandler.Click += new System.EventHandler(this.mnuGoToNmiHandler_Click);
//
// mnuGoToResetHandler
//
this.mnuGoToResetHandler.Name = "mnuGoToResetHandler";
this.mnuGoToResetHandler.Size = new System.Drawing.Size(158, 22);
this.mnuGoToResetHandler.Text = "Reset Handler";
this.mnuGoToResetHandler.Click += new System.EventHandler(this.mnuGoToResetHandler_Click);
//
// frmDebugger
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -775,5 +792,7 @@
private System.Windows.Forms.ToolStripMenuItem mnuGoToIrqHandler;
private System.Windows.Forms.ToolStripMenuItem mnuGoToNmiHandler;
private System.Windows.Forms.ToolStripMenuItem mnuGoToResetHandler;
private System.Windows.Forms.ToolStripMenuItem mnuTraceLogger;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem5;
}
}

View file

@ -9,10 +9,11 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Mesen.GUI.Forms;
namespace Mesen.GUI.Debugger
{
public partial class frmDebugger : Form
public partial class frmDebugger : BaseForm
{
private List<Form> _childForms = new List<Form>();
private InteropEmu.NotificationListener _notifListener;
@ -32,10 +33,6 @@ namespace Mesen.GUI.Debugger
{
base.OnLoad(e);
if(!DesignMode) {
Icon = Properties.Resources.MesenIcon;
}
_notifListener = new InteropEmu.NotificationListener();
_notifListener.OnNotification += _notifListener_OnNotification;
@ -335,5 +332,10 @@ namespace Mesen.GUI.Debugger
{
_lastCodeWindow.ScrollToLineNumber((int)((Breakpoint)sender).Address);
}
private void mnuTraceLogger_Click(object sender, EventArgs e)
{
new frmTraceLogger().Show();
}
}
}

View file

@ -0,0 +1,91 @@
namespace Mesen.GUI.Debugger
{
partial class frmTraceLogger
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if(disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.btnStartLogging = new System.Windows.Forms.Button();
this.btnStopLogging = new System.Windows.Forms.Button();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Controls.Add(this.btnStopLogging, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.btnStartLogging, 0, 0);
this.tableLayoutPanel1.Location = new System.Drawing.Point(57, 46);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(278, 144);
this.tableLayoutPanel1.TabIndex = 0;
//
// btnStartLogging
//
this.btnStartLogging.Location = new System.Drawing.Point(3, 3);
this.btnStartLogging.Name = "btnStartLogging";
this.btnStartLogging.Size = new System.Drawing.Size(95, 23);
this.btnStartLogging.TabIndex = 0;
this.btnStartLogging.Text = "Start Logging";
this.btnStartLogging.UseVisualStyleBackColor = true;
this.btnStartLogging.Click += new System.EventHandler(this.btnStartLogging_Click);
//
// btnStopLogging
//
this.btnStopLogging.Location = new System.Drawing.Point(142, 3);
this.btnStopLogging.Name = "btnStopLogging";
this.btnStopLogging.Size = new System.Drawing.Size(95, 23);
this.btnStopLogging.TabIndex = 1;
this.btnStopLogging.Text = "Stop Logging";
this.btnStopLogging.UseVisualStyleBackColor = true;
this.btnStopLogging.Click += new System.EventHandler(this.btnStopLogging_Click);
//
// frmTraceLogger
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(546, 233);
this.Controls.Add(this.tableLayoutPanel1);
this.Name = "frmTraceLogger";
this.Text = "Trace Logger";
this.tableLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Button btnStopLogging;
private System.Windows.Forms.Button btnStartLogging;
}
}

View file

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Mesen.GUI.Forms;
namespace Mesen.GUI.Debugger
{
public partial class frmTraceLogger : BaseForm
{
public frmTraceLogger()
{
InitializeComponent();
}
private void btnStartLogging_Click(object sender, EventArgs e)
{
TraceLoggingOptions options;
InteropEmu.DebugStartTraceLogger(options);
}
private void btnStopLogging_Click(object sender, EventArgs e)
{
InteropEmu.DebugStopTraceLogger();
}
}
}

View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -207,6 +207,12 @@
<Compile Include="Debugger\frmPpuViewer.Designer.cs">
<DependentUpon>frmPpuViewer.cs</DependentUpon>
</Compile>
<Compile Include="Debugger\frmTraceLogger.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Debugger\frmTraceLogger.Designer.cs">
<DependentUpon>frmTraceLogger.cs</DependentUpon>
</Compile>
<Compile Include="Forms\BaseConfigForm.Designer.cs">
<DependentUpon>BaseConfigForm.cs</DependentUpon>
</Compile>
@ -349,6 +355,9 @@
<EmbeddedResource Include="Debugger\frmPpuViewer.resx">
<DependentUpon>frmPpuViewer.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Debugger\frmTraceLogger.resx">
<DependentUpon>frmTraceLogger.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\BaseConfigForm.resx">
<DependentUpon>BaseConfigForm.cs</DependentUpon>
</EmbeddedResource>

View file

@ -95,7 +95,9 @@ namespace Mesen.GUI
[DllImport(DLLPath)] public static extern UInt32 DebugGetRelativeAddress(UInt32 addr);
[DllImport(DLLPath)] public static extern void DebugSetNextStatement(UInt16 addr);
[DllImport(DLLPath)] public static extern Int32 DebugEvaluateExpression([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(UTF8Marshaler))]string expression, out EvalResultType resultType);
[DllImport(DLLPath)] public static extern void DebugStartTraceLogger(TraceLoggingOptions options);
[DllImport(DLLPath)] public static extern void DebugStopTraceLogger();
[DllImport(DLLPath)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool DebugLoadCdlFile([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(UTF8Marshaler))]string cdlFilepath);
[DllImport(DLLPath)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool DebugSaveCdlFile([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(UTF8Marshaler))]string cdlFilepath);
@ -392,7 +394,13 @@ namespace Mesen.GUI
public bool NMIFlag;
public UInt16 DebugPC;
};
}
public struct TraceLoggingOptions
{
}
[Flags]
public enum IRQSource : uint

View file

@ -57,4 +57,7 @@ extern "C"
DllExport void __stdcall DebugResetCdlLog() { GetDebugger()->ResetCdlLog(); }
DllExport int32_t __stdcall DebugEvaluateExpression(char* expression, EvalResultType *resultType) { return GetDebugger()->EvaluateExpression(expression, *resultType); }
DllExport void __stdcall DebugStartTraceLogger(TraceLoggerOptions options) { GetDebugger()->StartTraceLogger(options); }
DllExport void __stdcall DebugStopTraceLogger() { GetDebugger()->StopTraceLogger(); }
};