[pspplayer commit] r592 - in trunk/Noxa.Emulation.Psp.Player/Debugger: . Tools

0 views
Skip to first unread message

codesite...@google.com

unread,
Mar 24, 2008, 1:19:20 AM3/24/08
to psppla...@googlegroups.com
Author: ben.vanik
Date: Sun Mar 23 22:18:11 2008
New Revision: 592

Modified:
trunk/Noxa.Emulation.Psp.Player/Debugger/DebuggerWindow.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/InprocDebugger.Handlers.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/InprocDebugger.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeViewControl.cs

Log:
Status bar now reads basic state info
Basic state setup so that things are enabled/disabled right, kind of
Usable enough for now :)

Modified: trunk/Noxa.Emulation.Psp.Player/Debugger/DebuggerWindow.cs
==============================================================================
--- trunk/Noxa.Emulation.Psp.Player/Debugger/DebuggerWindow.cs (original)
+++ trunk/Noxa.Emulation.Psp.Player/Debugger/DebuggerWindow.cs Sun Mar
23 22:18:11 2008
@@ -18,6 +18,7 @@
partial class DebuggerWindow : Form
{
public readonly InprocDebugger Debugger;
+ public DockPanel DockPanel { get { return this.dockPanel; } }

public DebuggerWindow()
{
@@ -28,9 +29,39 @@
: this()
{
this.Debugger = debugger;
+ this.Debugger.StateChanged += new EventHandler(
Debugger_StateChanged );
}

- public DockPanel DockPanel { get { return this.dockPanel; } }
+ private void Debugger_StateChanged( object sender, EventArgs e )
+ {
+ bool isRunning = ( this.Debugger.State == DebuggerState.Running );
+ this.resumeToolStripButton.Enabled = !isRunning;
+ this.resumeToolStripMenuItem.Enabled = !isRunning;
+ this.breakToolStripButton.Enabled = isRunning;
+ this.breakToolStripMenuItem.Enabled = isRunning;
+ this.stopToolStripButton.Enabled = false;
+ this.stopToolStripMenuItem.Enabled = false;
+ this.restartToolStripButton.Enabled = false;
+ this.restartToolStripMenuItem.Enabled = false;
+
+ this.showNextStatementToolStripMenuItem.Enabled = !isRunning;
+ this.showStatementToolStripButton.Enabled = !isRunning;
+ this.stepIntoToolStripButton.Enabled = !isRunning;
+ this.stepIntoToolStripMenuItem.Enabled = !isRunning;
+ this.stepOverToolStripButton.Enabled = !isRunning;
+ this.stepOverToolStripMenuItem.Enabled = !isRunning;
+ this.stepOutToolStripButton.Enabled = !isRunning;
+ this.stepOutToolStripMenuItem.Enabled = !isRunning;
+
+ this.editMenu.Enabled = !isRunning;
+ this.jumpMenu.Enabled = !isRunning;
+ this.searchMenu.Enabled = !isRunning;
+ }
+
+ public void SetStatusText( string text )
+ {
+ this.toolStripStatusLabel.Text = text;
+ }

private void exitToolsStripMenuItem_Click( object sender, EventArgs
e )
{

Modified: trunk/Noxa.Emulation.Psp.Player/Debugger/InprocDebugger.Handlers.cs
==============================================================================
--- trunk/Noxa.Emulation.Psp.Player/Debugger/InprocDebugger.Handlers.cs (original)
+++ trunk/Noxa.Emulation.Psp.Player/Debugger/InprocDebugger.Handlers.cs
Sun Mar 23 22:18:11 2008
@@ -21,6 +21,8 @@
if( steppingForward == false )
this.CodeTool.Disable();

+ this.SetStatusText( "Running..." );
+
this.State = DebuggerState.Running;
this.OnStateChanged();
};
@@ -31,6 +33,8 @@
{
DummyDelegate del = delegate
{
+ this.SetStatusText( "Step completed, now at 0x{0:X8}", address );
+
this.PC = address;
this.JumpToAddress( NavigationTarget.Code, address, true );

@@ -47,6 +51,7 @@
if( bp == null )
{
// Not found?
+ this.SetStatusText( "Breakpoint hit; ERROR BP NOT FOUND" );
return;
}

@@ -55,12 +60,18 @@
switch( bp.Type )
{
case BreakpointType.CodeExecute:
+ this.SetStatusText( "Breakpoint hit; now at 0x{0:X8}",
bp.Address );
+ this.PC = bp.Address;
+ this.JumpToAddress( NavigationTarget.Code, bp.Address, true );
+ break;
case BreakpointType.Stepping:
+ this.SetStatusText( "Step completed; now at 0x{0:X8}",
bp.Address );
this.PC = bp.Address;
this.JumpToAddress( NavigationTarget.Code, bp.Address, true );
break;
case BreakpointType.MemoryAccess:
uint pc = this.DebugHost.CpuHook.GetCoreState( 0 ).ProgramCounter;
+ this.SetStatusText( "Breakpoint hit; memory access at 0x{0:X8}
of 0x{1:X8}", pc, bp.Address );
this.PC = pc;
this.JumpToAddress( NavigationTarget.Memory, bp.Address, true );
this.JumpToAddress( NavigationTarget.Code, pc, true );
@@ -83,6 +94,8 @@
{
DummyDelegate del = delegate
{
+ this.SetStatusText( "Error hit at 0x{0:X8}: {1}", error.PC,
error.Message );
+
this.PC = error.PC;
this.JumpToAddress( NavigationTarget.Code, error.PC, true );


Modified: trunk/Noxa.Emulation.Psp.Player/Debugger/InprocDebugger.cs
==============================================================================
--- trunk/Noxa.Emulation.Psp.Player/Debugger/InprocDebugger.cs (original)
+++ trunk/Noxa.Emulation.Psp.Player/Debugger/InprocDebugger.cs Sun Mar
23 22:18:11 2008
@@ -157,9 +157,19 @@
public event EventHandler StateChanged;
private void OnStateChanged()
{
+ //DummyDelegate del = delegate
+ //{
+ //};
+ //this.Window.Invoke( del );
EventHandler handler = this.StateChanged;
if( handler != null )
handler( this, EventArgs.Empty );
+ }
+
+ public void SetStatusText( string format, params object[] args )
+ {
+ string final = ( args.Length == 0 ) ? format : string.Format(
format, args );
+ this.Window.SetStatusText( final );
}
}
}

Modified: trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeViewControl.cs
==============================================================================
--- trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeViewControl.cs (original)
+++ trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeViewControl.cs
Sun Mar 23 22:18:11 2008
@@ -245,6 +245,7 @@
if( body == null )
{
// TODO: status update?
+ _debugger.SetStatusText( "Could not find method for address
0x{0:X8} - unable to display", address );
this.Invalidate();
return;
}

Reply all
Reply to author
Forward
0 new messages