[pspplayer commit] r585 - in trunk: Noxa.Emulation.Psp.Bios.ManagedHLE Noxa.Emulation.Psp.Cpu.R4000Ultra Noxa.Emulat...

0 views
Skip to first unread message

codesite...@google.com

unread,
Mar 23, 2008, 2:46:44 PM3/23/08
to psppla...@googlegroups.com
Author: ben.vanik
Date: Sun Mar 23 11:45:56 2008
New Revision: 585

Added:
trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeViewControl.resx
Modified:
trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Loader.cs
trunk/Noxa.Emulation.Psp.Cpu.R4000Ultra/R4000Controller.cpp
trunk/Noxa.Emulation.Psp.Player/Debugger/DebuggerWindow.Designer.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/DebuggerWindow.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/InprocDebugger.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/Model/BreakpointManager.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeTool.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeViewControl.Designer.cs
trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeViewControl.cs
trunk/Noxa.Emulation.Psp.Player/Noxa.Emulation.Psp.Player.csproj
trunk/Noxa.Emulation.Psp/Debugging/Protocol/IDebugger.cs

Log:
Set breakpoint at application entry point on startup
Hooked up control tools in UI
Fixed breakpoint enable/disable
Basic gutter input in disassembly view - can set/unset/toggle breakpoints
Stepping works fairly well (hit f11 to step), although there comes a
point in PB when things stop working right (maybe after a syscall?)

Modified: trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Loader.cs
==============================================================================
--- trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Loader.cs (original)
+++ trunk/Noxa.Emulation.Psp.Bios.ManagedHLE/Loader.cs Sun Mar 23
11:45:56 2008
@@ -922,6 +922,10 @@
// Schedule so that our thread runs
kernel.Schedule();

+ // If debugging, set start breakpoint
+ if( Diag.IsAttached == true )
+ Diag.Instance.Client.OnBootModuleLoaded( results.EntryAddress );
+
//kernel.MemorySystem.DumpMainMemory( "startup.bin" );
}
}

Modified: trunk/Noxa.Emulation.Psp.Cpu.R4000Ultra/R4000Controller.cpp
==============================================================================
--- trunk/Noxa.Emulation.Psp.Cpu.R4000Ultra/R4000Controller.cpp (original)
+++ trunk/Noxa.Emulation.Psp.Cpu.R4000Ultra/R4000Controller.cpp Sun Mar
23 11:45:56 2008
@@ -184,6 +184,7 @@
Log::WriteLine( Verbosity::Critical, Feature::Debug, "breakpoint {0}
not found on __debugHandler - wtf?", breakpointId );
return DEBUG_HANDLE_CONTINUE;
}
+ Debug::Assert( breakpoint->Enabled == true );

int cacheVersion = cpu->_codeCache->Version;


Modified: trunk/Noxa.Emulation.Psp.Player/Debugger/DebuggerWindow.Designer.cs
==============================================================================
--- trunk/Noxa.Emulation.Psp.Player/Debugger/DebuggerWindow.Designer.cs (original)
+++ trunk/Noxa.Emulation.Psp.Player/Debugger/DebuggerWindow.Designer.cs
Sun Mar 23 11:45:56 2008
@@ -223,27 +223,28 @@
// jumpToOperandToolStripMenuItem
//
this.jumpToOperandToolStripMenuItem.Name = "jumpToOperandToolStripMenuItem";
- this.jumpToOperandToolStripMenuItem.Size = new System.Drawing.Size(
180, 22 );
+ this.jumpToOperandToolStripMenuItem.Size = new System.Drawing.Size(
204, 22 );
this.jumpToOperandToolStripMenuItem.Text = "Jump to &Operand";
this.jumpToOperandToolStripMenuItem.Click += new
System.EventHandler( this.jumpToOperandToolStripMenuItem_Click );
//
// jumpToAddressToolStripMenuItem
//
this.jumpToAddressToolStripMenuItem.Name = "jumpToAddressToolStripMenuItem";
- this.jumpToAddressToolStripMenuItem.Size = new System.Drawing.Size(
180, 22 );
+ this.jumpToAddressToolStripMenuItem.ShortcutKeys = ( (
System.Windows.Forms.Keys )( ( System.Windows.Forms.Keys.Control |
System.Windows.Forms.Keys.G ) ) );
+ this.jumpToAddressToolStripMenuItem.Size = new System.Drawing.Size(
204, 22 );
this.jumpToAddressToolStripMenuItem.Text = "Jump to &Address";
this.jumpToAddressToolStripMenuItem.Click += new
System.EventHandler( this.jumpToAddressToolStripMenuItem_Click );
//
// toolStripMenuItem4
//
this.toolStripMenuItem4.Name = "toolStripMenuItem4";
- this.toolStripMenuItem4.Size = new System.Drawing.Size( 177, 6 );
+ this.toolStripMenuItem4.Size = new System.Drawing.Size( 201, 6 );
//
// nextLocationToolStripMenuItem
//
this.nextLocationToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.NextLocationIcon;
this.nextLocationToolStripMenuItem.Name = "nextLocationToolStripMenuItem";
- this.nextLocationToolStripMenuItem.Size = new System.Drawing.Size(
180, 22 );
+ this.nextLocationToolStripMenuItem.Size = new System.Drawing.Size(
204, 22 );
this.nextLocationToolStripMenuItem.Text = "&Next Location";
this.nextLocationToolStripMenuItem.Click += new
System.EventHandler( this.nextLocationToolStripMenuItem_Click );
//
@@ -251,20 +252,20 @@
//
this.previousLocationToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.PreviousLocationIcon;
this.previousLocationToolStripMenuItem.Name = "previousLocationToolStripMenuItem";
- this.previousLocationToolStripMenuItem.Size = new
System.Drawing.Size( 180, 22 );
+ this.previousLocationToolStripMenuItem.Size = new
System.Drawing.Size( 204, 22 );
this.previousLocationToolStripMenuItem.Text = "&Previous Location";
this.previousLocationToolStripMenuItem.Click += new
System.EventHandler( this.previousLocationToolStripMenuItem_Click );
//
// toolStripMenuItem5
//
this.toolStripMenuItem5.Name = "toolStripMenuItem5";
- this.toolStripMenuItem5.Size = new System.Drawing.Size( 177, 6 );
+ this.toolStripMenuItem5.Size = new System.Drawing.Size( 201, 6 );
//
// toggleBookmarkToolStripMenuItem
//
this.toggleBookmarkToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.BookmarkIcon;
this.toggleBookmarkToolStripMenuItem.Name = "toggleBookmarkToolStripMenuItem";
- this.toggleBookmarkToolStripMenuItem.Size = new
System.Drawing.Size( 180, 22 );
+ this.toggleBookmarkToolStripMenuItem.Size = new
System.Drawing.Size( 204, 22 );
this.toggleBookmarkToolStripMenuItem.Text = "&Toggle Bookmark";
this.toggleBookmarkToolStripMenuItem.Click += new
System.EventHandler( this.toggleBookmarkToolStripMenuItem_Click );
//
@@ -272,7 +273,7 @@
//
this.nextBookmarkToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.NextBookmarkIcon;
this.nextBookmarkToolStripMenuItem.Name = "nextBookmarkToolStripMenuItem";
- this.nextBookmarkToolStripMenuItem.Size = new System.Drawing.Size(
180, 22 );
+ this.nextBookmarkToolStripMenuItem.Size = new System.Drawing.Size(
204, 22 );
this.nextBookmarkToolStripMenuItem.Text = "Next &Bookmark";
this.nextBookmarkToolStripMenuItem.Click += new
System.EventHandler( this.nextBookmarkToolStripMenuItem_Click );
//
@@ -280,7 +281,7 @@
//
this.previousBookmarkToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.PreviousBookmarkIcon;
this.previousBookmarkToolStripMenuItem.Name = "previousBookmarkToolStripMenuItem";
- this.previousBookmarkToolStripMenuItem.Size = new
System.Drawing.Size( 180, 22 );
+ this.previousBookmarkToolStripMenuItem.Size = new
System.Drawing.Size( 204, 22 );
this.previousBookmarkToolStripMenuItem.Text = "P&revious Bookmark";
this.previousBookmarkToolStripMenuItem.Click += new
System.EventHandler( this.previousBookmarkToolStripMenuItem_Click );
//
@@ -288,7 +289,7 @@
//
this.clearAllBookmarksToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.DeleteAllBookmarksIcon;
this.clearAllBookmarksToolStripMenuItem.Name = "clearAllBookmarksToolStripMenuItem";
- this.clearAllBookmarksToolStripMenuItem.Size = new
System.Drawing.Size( 180, 22 );
+ this.clearAllBookmarksToolStripMenuItem.Size = new
System.Drawing.Size( 204, 22 );
this.clearAllBookmarksToolStripMenuItem.Text = "&Clear All Bookmarks";
this.clearAllBookmarksToolStripMenuItem.Click += new
System.EventHandler( this.clearAllBookmarksToolStripMenuItem_Click );
//
@@ -321,6 +322,7 @@
this.resumeToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F5;
this.resumeToolStripMenuItem.Size = new System.Drawing.Size( 206,
22 );
this.resumeToolStripMenuItem.Text = "&Resume";
+ this.resumeToolStripMenuItem.Click += new System.EventHandler(
this.resumeToolStripMenuItem_Click );
//
// breakToolStripMenuItem
//
@@ -330,6 +332,7 @@
| System.Windows.Forms.Keys.B ) ) );
this.breakToolStripMenuItem.Size = new System.Drawing.Size( 206, 22 );
this.breakToolStripMenuItem.Text = "&Break";
+ this.breakToolStripMenuItem.Click += new System.EventHandler(
this.breakToolStripMenuItem_Click );
//
// stopToolStripMenuItem
//
@@ -338,6 +341,7 @@
this.stopToolStripMenuItem.ShortcutKeys = ( (
System.Windows.Forms.Keys )( ( System.Windows.Forms.Keys.Shift |
System.Windows.Forms.Keys.F5 ) ) );
this.stopToolStripMenuItem.Size = new System.Drawing.Size( 206, 22 );
this.stopToolStripMenuItem.Text = "&Stop";
+ this.stopToolStripMenuItem.Click += new System.EventHandler(
this.stopToolStripMenuItem_Click );
//
// restartToolStripMenuItem
//
@@ -347,6 +351,7 @@
| System.Windows.Forms.Keys.F5 ) ) );
this.restartToolStripMenuItem.Size = new System.Drawing.Size( 206,
22 );
this.restartToolStripMenuItem.Text = "R&estart";
+ this.restartToolStripMenuItem.Click += new System.EventHandler(
this.restartToolStripMenuItem_Click );
//
// toolStripMenuItem3
//
@@ -357,9 +362,10 @@
//
this.showNextStatementToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.StatementIcon;
this.showNextStatementToolStripMenuItem.Name = "showNextStatementToolStripMenuItem";
- this.showNextStatementToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F9;
- this.showNextStatementToolStripMenuItem.Size = new
System.Drawing.Size( 206, 22 );
+ this.showNextStatementToolStripMenuItem.ShortcutKeys = ( (
System.Windows.Forms.Keys )( ( System.Windows.Forms.Keys.Control |
System.Windows.Forms.Keys.F11 ) ) );
+ this.showNextStatementToolStripMenuItem.Size = new
System.Drawing.Size( 239, 22 );
this.showNextStatementToolStripMenuItem.Text = "Show &Next Statement";
+ this.showNextStatementToolStripMenuItem.Click += new
System.EventHandler( this.showNextStatementToolStripMenuItem_Click );
//
// stepIntoToolStripMenuItem
//
@@ -368,6 +374,7 @@
this.stepIntoToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F11;
this.stepIntoToolStripMenuItem.Size = new System.Drawing.Size( 206,
22 );
this.stepIntoToolStripMenuItem.Text = "Step &Into";
+ this.stepIntoToolStripMenuItem.Click += new System.EventHandler(
this.stepIntoToolStripMenuItem_Click );
//
// stepOverToolStripMenuItem
//
@@ -376,6 +383,7 @@
this.stepOverToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F10;
this.stepOverToolStripMenuItem.Size = new System.Drawing.Size( 206,
22 );
this.stepOverToolStripMenuItem.Text = "Step &Over";
+ this.stepOverToolStripMenuItem.Click += new System.EventHandler(
this.stepOverToolStripMenuItem_Click );
//
// stepOutToolStripMenuItem
//
@@ -384,6 +392,7 @@
this.stepOutToolStripMenuItem.ShortcutKeys = ( (
System.Windows.Forms.Keys )( ( System.Windows.Forms.Keys.Shift |
System.Windows.Forms.Keys.F11 ) ) );
this.stepOutToolStripMenuItem.Size = new System.Drawing.Size( 206,
22 );
this.stepOutToolStripMenuItem.Text = "Step Ou&t";
+ this.stepOutToolStripMenuItem.Click += new System.EventHandler(
this.stepOutToolStripMenuItem_Click );
//
// windowMenu
//
@@ -408,80 +417,80 @@
//
this.codeViewToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.DisassemblyIcon;
this.codeViewToolStripMenuItem.Name = "codeViewToolStripMenuItem";
- this.codeViewToolStripMenuItem.Size = new System.Drawing.Size( 151,
22 );
+ this.codeViewToolStripMenuItem.Size = new System.Drawing.Size( 152,
22 );
this.codeViewToolStripMenuItem.Text = "&Code View";
//
// memoryToolStripMenuItem
//
this.memoryToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.MemoryIcon;
this.memoryToolStripMenuItem.Name = "memoryToolStripMenuItem";
- this.memoryToolStripMenuItem.Size = new System.Drawing.Size( 151,
22 );
+ this.memoryToolStripMenuItem.Size = new System.Drawing.Size( 152,
22 );
this.memoryToolStripMenuItem.Text = "&Memory";
//
// callstackToolStripMenuItem
//
this.callstackToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.CallstackIcon;
this.callstackToolStripMenuItem.Name = "callstackToolStripMenuItem";
- this.callstackToolStripMenuItem.Size = new System.Drawing.Size(
151, 22 );
+ this.callstackToolStripMenuItem.Size = new System.Drawing.Size(
152, 22 );
this.callstackToolStripMenuItem.Text = "&Callstack";
//
// registersToolStripMenuItem
//
this.registersToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.RegistersIcon;
this.registersToolStripMenuItem.Name = "registersToolStripMenuItem";
- this.registersToolStripMenuItem.Size = new System.Drawing.Size(
151, 22 );
+ this.registersToolStripMenuItem.Size = new System.Drawing.Size(
152, 22 );
this.registersToolStripMenuItem.Text = "&Registers";
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
- this.toolStripMenuItem2.Size = new System.Drawing.Size( 148, 6 );
+ this.toolStripMenuItem2.Size = new System.Drawing.Size( 149, 6 );
//
// biosToolStripMenuItem
//
this.biosToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.OsIcon;
this.biosToolStripMenuItem.Name = "biosToolStripMenuItem";
- this.biosToolStripMenuItem.Size = new System.Drawing.Size( 151, 22 );
+ this.biosToolStripMenuItem.Size = new System.Drawing.Size( 152, 22 );
this.biosToolStripMenuItem.Text = "&BIOS Inspector";
//
// threadsToolStripMenuItem
//
this.threadsToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.ThreadsIcon;
this.threadsToolStripMenuItem.Name = "threadsToolStripMenuItem";
- this.threadsToolStripMenuItem.Size = new System.Drawing.Size( 151,
22 );
+ this.threadsToolStripMenuItem.Size = new System.Drawing.Size( 152,
22 );
this.threadsToolStripMenuItem.Text = "&Threads";
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
- this.toolStripMenuItem1.Size = new System.Drawing.Size( 148, 6 );
+ this.toolStripMenuItem1.Size = new System.Drawing.Size( 149, 6 );
//
// breakpointsToolStripMenuItem
//
this.breakpointsToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.BreakpointsIcon;
this.breakpointsToolStripMenuItem.Name = "breakpointsToolStripMenuItem";
- this.breakpointsToolStripMenuItem.Size = new System.Drawing.Size(
151, 22 );
+ this.breakpointsToolStripMenuItem.Size = new System.Drawing.Size(
152, 22 );
this.breakpointsToolStripMenuItem.Text = "B&reakpoints";
//
// watchesToolStripMenuItem
//
this.watchesToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.WatchesIcon;
this.watchesToolStripMenuItem.Name = "watchesToolStripMenuItem";
- this.watchesToolStripMenuItem.Size = new System.Drawing.Size( 151,
22 );
+ this.watchesToolStripMenuItem.Size = new System.Drawing.Size( 152,
22 );
this.watchesToolStripMenuItem.Text = "&Watches";
//
// statisticsToolStripMenuItem
//
this.statisticsToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.StatisticsIcon;
this.statisticsToolStripMenuItem.Name = "statisticsToolStripMenuItem";
- this.statisticsToolStripMenuItem.Size = new System.Drawing.Size(
151, 22 );
+ this.statisticsToolStripMenuItem.Size = new System.Drawing.Size(
152, 22 );
this.statisticsToolStripMenuItem.Text = "&Statistics";
//
// logViewToolStripMenuItem
//
this.logViewToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.OutputIcon;
this.logViewToolStripMenuItem.Name = "logViewToolStripMenuItem";
- this.logViewToolStripMenuItem.Size = new System.Drawing.Size( 151,
22 );
+ this.logViewToolStripMenuItem.Size = new System.Drawing.Size( 152,
22 );
this.logViewToolStripMenuItem.Text = "&Log View";
//
// toolsMenu
@@ -604,7 +613,7 @@
this.resumeToolStripButton.Size = new System.Drawing.Size( 23, 22 );
this.resumeToolStripButton.Text = "Resume";
this.resumeToolStripButton.ToolTipText = "Resume Execution";
- this.resumeToolStripButton.Click += new System.EventHandler(
this.resumeToolStripButton_Click );
+ this.resumeToolStripButton.Click += new System.EventHandler(
this.resumeToolStripMenuItem_Click );
//
// breakToolStripButton
//
@@ -615,28 +624,30 @@
this.breakToolStripButton.Size = new System.Drawing.Size( 23, 22 );
this.breakToolStripButton.Text = "Break";
this.breakToolStripButton.ToolTipText = "Break Execution";
- this.breakToolStripButton.Click += new System.EventHandler(
this.breakToolStripButton_Click );
+ this.breakToolStripButton.Click += new System.EventHandler(
this.breakToolStripMenuItem_Click );
//
// stopToolStripButton
//
this.stopToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.stopToolStripButton.Enabled = false;
this.stopToolStripButton.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.StopIcon;
this.stopToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.stopToolStripButton.Name = "stopToolStripButton";
this.stopToolStripButton.Size = new System.Drawing.Size( 23, 22 );
this.stopToolStripButton.Text = "Stop";
this.stopToolStripButton.ToolTipText = "Stop Execution";
- this.stopToolStripButton.Click += new System.EventHandler(
this.stopToolStripButton_Click );
+ this.stopToolStripButton.Click += new System.EventHandler(
this.stopToolStripMenuItem_Click );
//
// restartToolStripButton
//
this.restartToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.restartToolStripButton.Enabled = false;
this.restartToolStripButton.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.RestartIcon;
this.restartToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.restartToolStripButton.Name = "restartToolStripButton";
this.restartToolStripButton.Size = new System.Drawing.Size( 23, 22 );
this.restartToolStripButton.Text = "Restart";
- this.restartToolStripButton.Click += new System.EventHandler(
this.restartToolStripButton_Click );
+ this.restartToolStripButton.Click += new System.EventHandler(
this.restartToolStripMenuItem_Click );
//
// toolStripSeparator9
//
@@ -651,6 +662,7 @@
this.showStatementToolStripButton.Name = "showStatementToolStripButton";
this.showStatementToolStripButton.Size = new System.Drawing.Size(
23, 22 );
this.showStatementToolStripButton.Text = "Show Next Statement";
+ this.showStatementToolStripButton.Click += new System.EventHandler(
this.showNextStatementToolStripMenuItem_Click );
//
// stepIntoToolStripButton
//
@@ -660,6 +672,7 @@
this.stepIntoToolStripButton.Name = "stepIntoToolStripButton";
this.stepIntoToolStripButton.Size = new System.Drawing.Size( 23, 22 );
this.stepIntoToolStripButton.Text = "Step Into";
+ this.stepIntoToolStripButton.Click += new System.EventHandler(
this.stepIntoToolStripMenuItem_Click );
//
// stepOverToolStripButton
//
@@ -669,6 +682,7 @@
this.stepOverToolStripButton.Name = "stepOverToolStripButton";
this.stepOverToolStripButton.Size = new System.Drawing.Size( 23, 22 );
this.stepOverToolStripButton.Text = "Step Over";
+ this.stepOverToolStripButton.Click += new System.EventHandler(
this.stepOverToolStripMenuItem_Click );
//
// stepOutToolStripButton
//
@@ -678,6 +692,7 @@
this.stepOutToolStripButton.Name = "stepOutToolStripButton";
this.stepOutToolStripButton.Size = new System.Drawing.Size( 23, 22 );
this.stepOutToolStripButton.Text = "Step Out";
+ this.stepOutToolStripButton.Click += new System.EventHandler(
this.stepOutToolStripMenuItem_Click );
//
// toolStripSeparator10
//

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 11:45:56 2008
@@ -88,22 +88,44 @@

#region Control

- private void resumeToolStripButton_Click( object sender, EventArgs e )
+ private void resumeToolStripMenuItem_Click( object sender, EventArgs
e )
{
this.Debugger.DebugHost.Controller.Run();
}

- private void breakToolStripButton_Click( object sender, EventArgs e )
+ private void breakToolStripMenuItem_Click( object sender, EventArgs
e )
{
this.Debugger.DebugHost.Controller.Break();
}

- private void stopToolStripButton_Click( object sender, EventArgs e )
+ private void stopToolStripMenuItem_Click( object sender, EventArgs e )
{
+
+ }
+
+ private void restartToolStripMenuItem_Click( object sender,
EventArgs e )
+ {
+
+ }
+
+ private void showNextStatementToolStripMenuItem_Click( object
sender, EventArgs e )
+ {
+ this.Debugger.JumpToAddress( NavigationTarget.Code,
this.Debugger.PC, true );
+ }
+
+ private void stepIntoToolStripMenuItem_Click( object sender,
EventArgs e )
+ {
+ this.Debugger.DebugHost.Controller.Step();
+ }
+
+ private void stepOverToolStripMenuItem_Click( object sender,
EventArgs e )
+ {
+ this.Debugger.DebugHost.Controller.StepOver();
}

- private void restartToolStripButton_Click( object sender, EventArgs
e )
+ private void stepOutToolStripMenuItem_Click( object sender,
EventArgs e )
{
+ this.Debugger.DebugHost.Controller.StepOut();
}

#endregion

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 11:45:56 2008
@@ -106,14 +106,6 @@
tool.OnStarted();
};
this.Window.Invoke( del );
-
- // TEST
- Breakpoint bp1 = new Breakpoint( this.AllocateID(),
BreakpointType.CodeExecute, 0x088003D4 );
- this.Breakpoints.Add( bp1 );
- Breakpoint bp2 = new Breakpoint( this.AllocateID(), 0x09FFFEF4,
Noxa.Emulation.Psp.Debugging.Hooks.MemoryAccessType.ReadWrite );
- this.Breakpoints.Add( bp2 );
- Breakpoint bp3 = new Breakpoint( this.AllocateID(),
BreakpointType.CodeExecute, 0x08800330 );
- this.Breakpoints.Add( bp3 );
}

public void OnStopped()
@@ -124,6 +116,16 @@
this.OnStateChanged();
};
this.Window.Invoke( del );
+ }
+
+ public void OnBootModuleLoaded( uint entryAddress )
+ {
+ Breakpoint startupBp = new Breakpoint( this.AllocateID(),
BreakpointType.CodeExecute, entryAddress );
+ this.Breakpoints.Add( startupBp );
+
+ // TEST
+ //Breakpoint bp2 = new Breakpoint( this.AllocateID(), 0x09FFFEF4,
Noxa.Emulation.Psp.Debugging.Hooks.MemoryAccessType.ReadWrite );
+ //this.Breakpoints.Add( bp2 );
}

public void OnModuleLoaded()

Modified: trunk/Noxa.Emulation.Psp.Player/Debugger/Model/BreakpointManager.cs
==============================================================================
--- trunk/Noxa.Emulation.Psp.Player/Debugger/Model/BreakpointManager.cs (original)
+++ trunk/Noxa.Emulation.Psp.Player/Debugger/Model/BreakpointManager.cs
Sun Mar 23 11:45:56 2008
@@ -199,14 +199,23 @@
{
Breakpoint breakpoint = this[ id ];
Debug.Assert( breakpoint != null );
+ if( breakpoint == null )
+ return;
+ this.ToggleBreakpoint( breakpoint );
+ }
+
+ public void ToggleBreakpoint( Breakpoint breakpoint )
+ {
bool old = breakpoint.Enabled;
- breakpoint.Enabled = !old;
- this.OnBreakpointToggled( breakpoint );
+ Breakpoint dummy = new Breakpoint( breakpoint.ID, breakpoint.Type,
breakpoint.Address );
+ dummy.Mode = breakpoint.Mode;
+ dummy.Enabled = !old;
+ this.OnBreakpointToggled( breakpoint, dummy );
}

- internal void OnBreakpointToggled( Breakpoint breakpoint )
+ internal void OnBreakpointToggled( Breakpoint breakpoint, Breakpoint
changed )
{
- this.Debugger.DebugHost.CpuHook.UpdateBreakpoint( breakpoint );
+ this.Debugger.DebugHost.CpuHook.UpdateBreakpoint( changed );
if( this.Toggled != null )
this.Toggled( this, new BreakpointEventArgs( breakpoint ) );
}

Modified: trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeTool.cs
==============================================================================
--- trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeTool.cs (original)
+++ trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeTool.cs Sun Mar
23 11:45:56 2008
@@ -60,117 +60,13 @@
this.codeView.Enabled = true;
this.codeView.SetAddress( address );
this.codeView.Focus();
+ this.registersControl.Enabled = true;
this.registersControl.Invalidate();
}

public void ShowNextStatement()
{
- CoreState state = this.Debugger.DebugHost.CpuHook.GetCoreState( 0 );
- this.SetAddress( state.ProgramCounter, true );
+ this.SetAddress( this.Debugger.PC, true );
}
-
- #region Registers
-
- //private void ShowRegisters( RegisterSet set )
- //{
- // CoreState state = this.Debugger.Host.CpuHook.GetCoreState( 0 );
- // this.pcTextBox.Text = string.Format( "0x{0:X8}",
state.ProgramCounter );
-
- // if( this.CurrentRegisterSet != set )
- // {
- // this.CurrentRegisterSet = set;
- // switch( set )
- // {
- // case RegisterSet.Gpr:
- // this.registerToggleToolStripSplitButton.Text = "GPR";
- // break;
- // case RegisterSet.Fpu:
- // this.registerToggleToolStripSplitButton.Text = "FPU";
- // break;
- // case RegisterSet.Vfpu:
- // this.registerToggleToolStripSplitButton.Text = "VFPU";
- // break;
- // }
- // }
-
- // RegisterBank bank;
- // switch( set )
- // {
- // default:
- // case RegisterSet.Gpr:
- // bank = RegisterBanks.General;
- // break;
- // case RegisterSet.Fpu:
- // bank = RegisterBanks.Fpu;
- // break;
- // case RegisterSet.Vfpu:
- // bank = RegisterBanks.Vfpu;
- // break;
- // }
-
- // this.registersListView.BeginUpdate();
- // this.registersListView.Items.Clear();
- // foreach( Register register in bank.Registers )
- // {
- // string prettyValue = string.Empty;
- // string rawValue = string.Empty;
- // switch( set )
- // {
- // case RegisterSet.Gpr:
- // uint uv =
this.Debugger.Host.CpuHook.GetRegister<uint>( set, register.Ordinal );
- // prettyValue = uv.ToString();
- // rawValue = string.Format( "{0:X8}", uv );
- // break;
- // case RegisterSet.Fpu:
- // case RegisterSet.Vfpu:
- // float fv =
this.Debugger.Host.CpuHook.GetRegister<float>( set, register.Ordinal );
- // prettyValue = fv.ToString();
- // break;
- // }
- // ListViewItem item = new ListViewItem( new string[]{
- // register.ToString(), prettyValue, rawValue,
- // } );
- // this.registersListView.Items.Add( item );
- // }
- // this.registersListView.EndUpdate();
- //}
-
- //private void disassemblyControl1_RegisterValueChanged( object
sender, EventArgs e )
- //{
- // this.ShowRegisters( this.CurrentRegisterSet );
- //}
-
- //private void registerToggleToolStripSplitButton_ButtonClick(
object sender, EventArgs e )
- //{
- // switch( this.CurrentRegisterSet )
- // {
- // case RegisterSet.Gpr:
- // this.ShowRegisters( RegisterSet.Fpu );
- // break;
- // case RegisterSet.Fpu:
- // this.ShowRegisters( RegisterSet.Vfpu );
- // break;
- // case RegisterSet.Vfpu:
- // this.ShowRegisters( RegisterSet.Gpr );
- // break;
- // }
- //}
-
- //private void generalRegistersToolStripMenuItem_Click( object
sender, EventArgs e )
- //{
- // this.ShowRegisters( RegisterSet.Gpr );
- //}
-
- //private void fPURegistersToolStripMenuItem_Click( object sender,
EventArgs e )
- //{
- // this.ShowRegisters( RegisterSet.Fpu );
- //}
-
- //private void vFPURegistersToolStripMenuItem_Click( object sender,
EventArgs e )
- //{
- // this.ShowRegisters( RegisterSet.Vfpu );
- //}
-
- #endregion
}
}

Modified: trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeViewControl.Designer.cs
==============================================================================
---
trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeViewControl.Designer.cs (original)
+++
trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeViewControl.Designer.cs
Sun Mar 23 11:45:56 2008
@@ -34,9 +34,238 @@
/// </summary>
private void InitializeComponent()
{
- components = new System.ComponentModel.Container();
+ this.components = new System.ComponentModel.Container();
+ this.toolTip = new System.Windows.Forms.ToolTip( this.components );
+ this.lineContextMenuStrip = new
System.Windows.Forms.ContextMenuStrip( this.components );
+ this.valueToolStripTextBox = new System.Windows.Forms.ToolStripTextBox();
+ this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
+ this.copyOperandToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.goToTargetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
+ this.showNextToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.runToCursorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.setNextToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
+ this.copyLineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.copyAddressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.copyInstructionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
+ this.lineBreakpointToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.gutterContextMenuStrip = new
System.Windows.Forms.ContextMenuStrip( this.components );
+ this.toggleBreakpointToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.renameBreakpointToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+ this.addBreakpointToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.removeBreakpointToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.lineContextMenuStrip.SuspendLayout();
+ this.gutterContextMenuStrip.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // toolTip
+ //
+ this.toolTip.AutoPopDelay = 5000;
+ this.toolTip.InitialDelay = 250;
+ this.toolTip.ReshowDelay = 100;
+ //
+ // lineContextMenuStrip
+ //
+ this.lineContextMenuStrip.Items.AddRange( new
System.Windows.Forms.ToolStripItem[] {
+ this.valueToolStripTextBox,
+ this.toolStripSeparator5,
+ this.copyOperandToolStripMenuItem,
+ this.goToTargetToolStripMenuItem,
+ this.toolStripSeparator4,
+ this.showNextToolStripMenuItem,
+ this.runToCursorToolStripMenuItem,
+ this.setNextToolStripMenuItem,
+ this.toolStripSeparator2,
+ this.copyLineToolStripMenuItem,
+ this.copyAddressToolStripMenuItem,
+ this.copyInstructionToolStripMenuItem,
+ this.toolStripSeparator3,
+ this.lineBreakpointToolStripMenuItem} );
+ this.lineContextMenuStrip.Name = "addressContextMenuStrip";
+ this.lineContextMenuStrip.Size = new System.Drawing.Size( 188, 249 );
+ this.lineContextMenuStrip.Closed += new
System.Windows.Forms.ToolStripDropDownClosedEventHandler(
this.GeneralContextClosed );
+ this.lineContextMenuStrip.Opening += new
System.ComponentModel.CancelEventHandler(
this.lineContextMenuStrip_Opening );
+ //
+ // valueToolStripTextBox
+ //
+ this.valueToolStripTextBox.AutoSize = false;
+ this.valueToolStripTextBox.Font = new System.Drawing.Font( "Courier
New", 9F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ( ( byte )( 0 ) ) );
+ this.valueToolStripTextBox.Name = "valueToolStripTextBox";
+ this.valueToolStripTextBox.Size = new System.Drawing.Size( 100, 21 );
+ this.valueToolStripTextBox.Text = "0xDEADBEEF";
+ this.valueToolStripTextBox.TextChanged += new System.EventHandler(
this.valueToolStripTextBox_TextChanged );
+ //
+ // toolStripSeparator5
+ //
+ this.toolStripSeparator5.Name = "toolStripSeparator5";
+ this.toolStripSeparator5.Size = new System.Drawing.Size( 184, 6 );
+ //
+ // copyOperandToolStripMenuItem
+ //
+ this.copyOperandToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.CopyIcon;
+ this.copyOperandToolStripMenuItem.Name = "copyOperandToolStripMenuItem";
+ this.copyOperandToolStripMenuItem.Size = new System.Drawing.Size(
187, 22 );
+ this.copyOperandToolStripMenuItem.Text = "Copy &Value";
+ this.copyOperandToolStripMenuItem.Click += new System.EventHandler(
this.copyOperandToolStripMenuItem_Click );
+ //
+ // goToTargetToolStripMenuItem
+ //
+ this.goToTargetToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.StatementCallIcon;
+ this.goToTargetToolStripMenuItem.Name = "goToTargetToolStripMenuItem";
+ this.goToTargetToolStripMenuItem.Size = new System.Drawing.Size(
187, 22 );
+ this.goToTargetToolStripMenuItem.Text = "&Go to Target";
+ this.goToTargetToolStripMenuItem.Click += new System.EventHandler(
this.goToTargetToolStripMenuItem_Click );
+ //
+ // toolStripSeparator4
+ //
+ this.toolStripSeparator4.Name = "toolStripSeparator4";
+ this.toolStripSeparator4.Size = new System.Drawing.Size( 184, 6 );
+ //
+ // showNextToolStripMenuItem
+ //
+ this.showNextToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.StatementIcon;
+ this.showNextToolStripMenuItem.Name = "showNextToolStripMenuItem";
+ this.showNextToolStripMenuItem.Size = new System.Drawing.Size( 187,
22 );
+ this.showNextToolStripMenuItem.Text = "Show &Next Statement";
+ this.showNextToolStripMenuItem.Click += new System.EventHandler(
this.showNextToolStripMenuItem_Click );
+ //
+ // runToCursorToolStripMenuItem
+ //
+ this.runToCursorToolStripMenuItem.Name = "runToCursorToolStripMenuItem";
+ this.runToCursorToolStripMenuItem.Size = new System.Drawing.Size(
187, 22 );
+ this.runToCursorToolStripMenuItem.Text = "&Run to Cursor";
+ this.runToCursorToolStripMenuItem.Click += new System.EventHandler(
this.runToCursorToolStripMenuItem_Click );
+ //
+ // setNextToolStripMenuItem
+ //
+ this.setNextToolStripMenuItem.Name = "setNextToolStripMenuItem";
+ this.setNextToolStripMenuItem.Size = new System.Drawing.Size( 187,
22 );
+ this.setNextToolStripMenuItem.Text = "&Set Next Statement";
+ this.setNextToolStripMenuItem.Click += new System.EventHandler(
this.setNextToolStripMenuItem_Click );
+ //
+ // toolStripSeparator2
+ //
+ this.toolStripSeparator2.Name = "toolStripSeparator2";
+ this.toolStripSeparator2.Size = new System.Drawing.Size( 184, 6 );
+ //
+ // copyLineToolStripMenuItem
+ //
+ this.copyLineToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.CopyIcon;
+ this.copyLineToolStripMenuItem.Name = "copyLineToolStripMenuItem";
+ this.copyLineToolStripMenuItem.Size = new System.Drawing.Size( 187,
22 );
+ this.copyLineToolStripMenuItem.Text = "Copy &Line";
+ this.copyLineToolStripMenuItem.Click += new System.EventHandler(
this.copyLineToolStripMenuItem_Click );
+ //
+ // copyAddressToolStripMenuItem
+ //
+ this.copyAddressToolStripMenuItem.Name = "copyAddressToolStripMenuItem";
+ this.copyAddressToolStripMenuItem.Size = new System.Drawing.Size(
187, 22 );
+ this.copyAddressToolStripMenuItem.Text = "Copy &Address";
+ this.copyAddressToolStripMenuItem.Click += new System.EventHandler(
this.copyAddressToolStripMenuItem_Click );
+ //
+ // copyInstructionToolStripMenuItem
+ //
+ this.copyInstructionToolStripMenuItem.Name = "copyInstructionToolStripMenuItem";
+ this.copyInstructionToolStripMenuItem.Size = new
System.Drawing.Size( 187, 22 );
+ this.copyInstructionToolStripMenuItem.Text = "Copy &Instruction";
+ this.copyInstructionToolStripMenuItem.Click += new
System.EventHandler( this.copyInstructionToolStripMenuItem_Click );
+ //
+ // toolStripSeparator3
+ //
+ this.toolStripSeparator3.Name = "toolStripSeparator3";
+ this.toolStripSeparator3.Size = new System.Drawing.Size( 184, 6 );
+ //
+ // lineBreakpointToolStripMenuItem
+ //
+ this.lineBreakpointToolStripMenuItem.DropDown = this.gutterContextMenuStrip;
+ this.lineBreakpointToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.BreakpointIcon;
+ this.lineBreakpointToolStripMenuItem.Name = "lineBreakpointToolStripMenuItem";
+ this.lineBreakpointToolStripMenuItem.Size = new
System.Drawing.Size( 187, 22 );
+ this.lineBreakpointToolStripMenuItem.Text = "&Breakpoint";
+ this.lineBreakpointToolStripMenuItem.Text = "&Breakpoint";
+ //
+ // gutterContextMenuStrip
+ //
+ this.gutterContextMenuStrip.Items.AddRange( new
System.Windows.Forms.ToolStripItem[] {
+ this.toggleBreakpointToolStripMenuItem,
+ this.renameBreakpointToolStripMenuItem,
+ this.toolStripSeparator1,
+ this.addBreakpointToolStripMenuItem,
+ this.removeBreakpointToolStripMenuItem} );
+ this.gutterContextMenuStrip.Name = "gutterContextMenuStrip";
+ this.gutterContextMenuStrip.Size = new System.Drawing.Size( 178, 98 );
+ this.gutterContextMenuStrip.Closed += new
System.Windows.Forms.ToolStripDropDownClosedEventHandler(
this.GeneralContextClosed );
+ this.gutterContextMenuStrip.Opening += new
System.ComponentModel.CancelEventHandler(
this.gutterContextMenuStrip_Opening );
+ //
+ // toggleBreakpointToolStripMenuItem
+ //
+ this.toggleBreakpointToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.ToggleBreakpointIcon;
+ this.toggleBreakpointToolStripMenuItem.Name = "toggleBreakpointToolStripMenuItem";
+ this.toggleBreakpointToolStripMenuItem.Size = new
System.Drawing.Size( 177, 22 );
+ this.toggleBreakpointToolStripMenuItem.Text = "&Toggle Breakpoint";
+ this.toggleBreakpointToolStripMenuItem.Click += new
System.EventHandler( this.toggleBreakpointToolStripMenuItem_Click );
+ //
+ // renameBreakpointToolStripMenuItem
+ //
+ this.renameBreakpointToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.RenameIcon;
+ this.renameBreakpointToolStripMenuItem.Name = "renameBreakpointToolStripMenuItem";
+ this.renameBreakpointToolStripMenuItem.Size = new
System.Drawing.Size( 177, 22 );
+ this.renameBreakpointToolStripMenuItem.Text = "&Rename Breakpoint";
+ this.renameBreakpointToolStripMenuItem.Click += new
System.EventHandler( this.renameBreakpointToolStripMenuItem_Click );
+ //
+ // toolStripSeparator1
+ //
+ this.toolStripSeparator1.Name = "toolStripSeparator1";
+ this.toolStripSeparator1.Size = new System.Drawing.Size( 174, 6 );
+ //
+ // addBreakpointToolStripMenuItem
+ //
+ this.addBreakpointToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.NewBreakpointIcon;
+ this.addBreakpointToolStripMenuItem.Name = "addBreakpointToolStripMenuItem";
+ this.addBreakpointToolStripMenuItem.Size = new System.Drawing.Size(
177, 22 );
+ this.addBreakpointToolStripMenuItem.Text = "&Add Breakpoint";
+ this.addBreakpointToolStripMenuItem.Click += new
System.EventHandler( this.addBreakpointToolStripMenuItem_Click );
+ //
+ // removeBreakpointToolStripMenuItem
+ //
+ this.removeBreakpointToolStripMenuItem.Image = global::Noxa.Emulation.Psp.Player.Properties.Resources.DeleteBreakpointIcon;
+ this.removeBreakpointToolStripMenuItem.Name = "removeBreakpointToolStripMenuItem";
+ this.removeBreakpointToolStripMenuItem.Size = new
System.Drawing.Size( 177, 22 );
+ this.removeBreakpointToolStripMenuItem.Text = "&Delete Breakpoint";
+ this.removeBreakpointToolStripMenuItem.Click += new
System.EventHandler( this.removeBreakpointToolStripMenuItem_Click );
+ this.lineContextMenuStrip.ResumeLayout( false );
+ this.lineContextMenuStrip.PerformLayout();
+ this.gutterContextMenuStrip.ResumeLayout( false );
+ this.ResumeLayout( false );
+
}

#endregion
+
+ private System.Windows.Forms.ToolTip toolTip;
+ private System.Windows.Forms.ContextMenuStrip lineContextMenuStrip;
+ private System.Windows.Forms.ToolStripTextBox valueToolStripTextBox;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
+ private System.Windows.Forms.ToolStripMenuItem copyOperandToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem goToTargetToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
+ private System.Windows.Forms.ToolStripMenuItem showNextToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem runToCursorToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem setNextToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
+ private System.Windows.Forms.ToolStripMenuItem copyLineToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem copyAddressToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem copyInstructionToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
+ private System.Windows.Forms.ToolStripMenuItem lineBreakpointToolStripMenuItem;
+ private System.Windows.Forms.ContextMenuStrip gutterContextMenuStrip;
+ private System.Windows.Forms.ToolStripMenuItem toggleBreakpointToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem renameBreakpointToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
+ private System.Windows.Forms.ToolStripMenuItem addBreakpointToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem removeBreakpointToolStripMenuItem;
}
}

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 11:45:56 2008
@@ -11,8 +11,9 @@
using System.Drawing;
using System.Text;
using System.Windows.Forms;
-using Noxa.Emulation.Psp.Player.Debugger.Model;
using System.Windows.Forms.VisualStyles;
+using Noxa.Emulation.Psp.Debugging.DebugModel;
+using Noxa.Emulation.Psp.Player.Debugger.Model;

namespace Noxa.Emulation.Psp.Player.Debugger.Tools
{
@@ -143,7 +144,9 @@

#endregion

- #region Focus
+ #region Focus/Input
+
+ private int _hoveredIndex = -1;

protected override void OnMouseDown( MouseEventArgs e )
{
@@ -151,6 +154,27 @@
this.Focus();
}

+ protected override void OnMouseMove( MouseEventArgs e )
+ {
+ base.OnMouseMove( e );
+
+ int y = e.Y / _lineHeight;
+ _hoveredIndex = Math.Min( _firstVisibleLine + y, _totalLines );
+
+ if( e.X < 2 + _gutterWidth + 1 )
+ this.ContextMenuStrip = this.gutterContextMenuStrip;
+ else
+ this.ContextMenuStrip = this.lineContextMenuStrip;
+ }
+
+ protected override void OnMouseUp( MouseEventArgs e )
+ {
+ if( e.X < 2 + _gutterWidth + 1 )
+ this.GutterMouseUp( e );
+ else
+ base.OnMouseUp( e );
+ }
+
#endregion

#region Sizing/locations/etc
@@ -221,6 +245,7 @@
if( body == null )
{
// TODO: status update?
+ this.Invalidate();
return;
}

@@ -235,12 +260,14 @@
if( ( line >= _firstVisibleLine ) && ( line < _lastVisibleLine ) )
{
// Already in view
+ this.Invalidate();
return;
}

int targetLine = line - ( _visibleLines / 2 );
targetLine = Math.Max( Math.Min( targetLine, _totalLines ), 0 );
this.ScrollToLine( targetLine );
+ this.Invalidate();
}

private bool ScrollToLine( int targetLine )
@@ -621,6 +648,330 @@
}

return y;
+ }
+
+ #endregion
+
+ #region Context Menus
+
+ private int _contextIndex = -1;
+ private Operand _contextOperand;
+
+ private Instruction GetContextInstruction()
+ {
+ if( _contextIndex < 0 )
+ {
+ if( _hoveredIndex < 0 )
+ return null;
+ _contextIndex = _hoveredIndex;
+ }
+ int lineSum;
+ int methodIndex = this.IndexOfMethodAt( _contextIndex, out lineSum );
+ MethodBody method = _debugger.CodeCache.Methods[ methodIndex ];
+ int lineIndex = ( _contextIndex - lineSum );
+ List<Line> lines = ( List<Line> )method.UserCache;
+ Line line = lines[ lineIndex ];
+ return line.Instruction;
+ }
+
+ #region Gutter / Breakpoints
+
+ private void GutterMouseUp( MouseEventArgs e )
+ {
+ if( e.Button == MouseButtons.Right )
+ return;
+
+ Instruction instr = this.GetContextInstruction();
+ if( instr == null )
+ return;
+
+ bool hasBreakpoint = ( instr.Breakpoint != null );
+ if( e.Button == MouseButtons.Left )
+ {
+ if( hasBreakpoint == true )
+ {
+ // Delete breakpoint
+ this.removeBreakpointToolStripMenuItem_Click( this,
EventArgs.Empty );
+ }
+ else
+ {
+ // Add breakpoint
+ this.addBreakpointToolStripMenuItem_Click( this, EventArgs.Empty );
+ }
+ }
+ else if( e.Button == MouseButtons.Middle )
+ {
+ // Toggle
+ this.toggleBreakpointToolStripMenuItem_Click( this,
EventArgs.Empty );
+ }
+ }
+
+ private void gutterContextMenuStrip_Opening( object sender,
CancelEventArgs e )
+ {
+ Instruction instr = this.GetContextInstruction();
+ if( instr == null )
+ return;
+
+ bool hasBreakpoint = ( instr.Breakpoint != null );
+
+ if( hasBreakpoint == true )
+ {
+ bool breakpointEnabled = instr.Breakpoint.Enabled;
+ if( breakpointEnabled == true )
+ this.toggleBreakpointToolStripMenuItem.Text = "D&isable Breakpoint";
+ else
+ this.toggleBreakpointToolStripMenuItem.Text = "&Enable Breakpoint";
+ }
+ this.toggleBreakpointToolStripMenuItem.Visible = hasBreakpoint;
+ this.renameBreakpointToolStripMenuItem.Visible = hasBreakpoint;
+ this.toolStripSeparator1.Visible = hasBreakpoint;
+ this.addBreakpointToolStripMenuItem.Visible = !hasBreakpoint;
+ this.removeBreakpointToolStripMenuItem.Visible = hasBreakpoint;
+ }
+
+ private void addBreakpointToolStripMenuItem_Click( object sender,
EventArgs e )
+ {
+ Instruction instr = this.GetContextInstruction();
+ if( instr == null )
+ return;
+
+ Breakpoint bp = new Breakpoint( _debugger.AllocateID(),
BreakpointType.CodeExecute, instr.Address );
+ _debugger.Breakpoints.Add( bp );
+
+ this.ContextReturn();
+ }
+
+ private void removeBreakpointToolStripMenuItem_Click( object sender,
EventArgs e )
+ {
+ Instruction instr = this.GetContextInstruction();
+ if( instr == null )
+ return;
+
+ Breakpoint bp = instr.Breakpoint;
+ _debugger.Breakpoints.Remove( bp );
+
+ this.ContextReturn();
+ }
+
+ private void renameBreakpointToolStripMenuItem_Click( object sender,
EventArgs e )
+ {
+ Instruction instr = this.GetContextInstruction();
+ if( instr == null )
+ return;
+
+ //Breakpoint bp = this.Debugger.Breakpoints[ instr.BreakpointID ];
+ // TODO: rename breakpoint
+
+ this.ContextReturn();
+ }
+
+ private void toggleBreakpointToolStripMenuItem_Click( object sender,
EventArgs e )
+ {
+ Instruction instr = this.GetContextInstruction();
+ if( instr == null )
+ return;
+
+ if( instr.Breakpoint == null )
+ return;
+
+ _debugger.Breakpoints.ToggleBreakpoint( instr.Breakpoint );
+
+ this.ContextReturn();
+ }
+
+ #endregion
+
+ #region Line
+
+ private void lineContextMenuStrip_Opening( object sender,
CancelEventArgs e )
+ {
+ //if( _hoveredIndex < 0 )
+ // return;
+ //_contextIndex = _hoveredIndex;
+ //if( ( _hoveredColumn == Column.Instruction ) &&
+ // ( _hoveredValue != null ) )
+ //{
+ // if( _hoveredValue is CachedOperand )
+ // _contextOperand = ( ( CachedOperand )_hoveredValue ).Operand;
+ //}
+ Instruction instr = this.GetContextInstruction();
+ if( instr == null )
+ return;
+
+ bool hasOperand = ( _contextOperand != null );
+ bool referenceOperand = false;
+ if( hasOperand == true )
+ {
+ // Only allow editing if it's a register
+ bool readOnly =
+ ( _contextOperand.Register == null ) ||
+ ( _contextOperand.Register.ReadOnly == true );
+ this.valueToolStripTextBox.ReadOnly = readOnly;
+
+ // Only allow goto if a reference
+ referenceOperand =
+ ( _contextOperand.Type == OperandType.BranchTarget ) ||
+ ( _contextOperand.Type == OperandType.JumpTarget ) ||
+ ( _contextOperand.Type == OperandType.MemoryAccess );
+
+ if( ( referenceOperand == true ) &&
+ ( _contextOperand.Type == OperandType.MemoryAccess ) )
+ {
+ this.goToTargetToolStripMenuItem.Text = "&Go to Memory Address";
+ this.goToTargetToolStripMenuItem.Image = Properties.Resources.MemoryIcon;
+ }
+ else
+ {
+ this.goToTargetToolStripMenuItem.Text = "&Go to Code Address";
+ this.goToTargetToolStripMenuItem.Image = Properties.Resources.DisassemblyIcon;
+ }
+
+ //this.valueToolStripTextBox.Text = this.RequestOperandValue(
instr, _contextOperand, false );
+ this.valueToolStripTextBox.Modified = false;
+ }
+ this.valueToolStripTextBox.Visible = hasOperand;
+ this.toolStripSeparator5.Visible = hasOperand;
+ this.copyOperandToolStripMenuItem.Visible = hasOperand;
+ this.goToTargetToolStripMenuItem.Visible = hasOperand && referenceOperand;
+ this.toolStripSeparator4.Visible = hasOperand;
+ }
+
+ #region Operands
+
+ private void valueToolStripTextBox_TextChanged( object sender,
EventArgs e )
+ {
+ Instruction instr = this.GetContextInstruction();
+ if( instr == null )
+ return;
+
+ if( this.valueToolStripTextBox.Modified == true )
+ {
+ //Debug.WriteLine( "changed " + valueToolStripTextBox.Text );
+ //this.UpdateOperandValue( instr, _contextOperand,
this.valueToolStripTextBox.Text );
+ }
+ }
+
+ private void copyOperandToolStripMenuItem_Click( object sender,
EventArgs e )
+ {
+ Instruction instr = this.GetContextInstruction();
+ if( instr == null )
+ return;
+
+ Clipboard.Clear();
+ //Clipboard.SetText( this.RequestOperandValue( instr,
_contextOperand, false ), TextDataFormat.Text );
+
+ this.ContextReturn();
+ }
+
+ private void goToTargetToolStripMenuItem_Click( object sender,
EventArgs e )
+ {
+ Instruction instr = this.GetContextInstruction();
+ if( instr == null )
+ return;
+
+ this.ContextReturn();
+ }
+
+ #endregion
+
+ #region Clipboard
+
+ private void copyAddressToolStripMenuItem_Click( object sender,
EventArgs e )
+ {
+ Instruction instr = this.GetContextInstruction();
+ if( instr == null )
+ return;
+
+ Clipboard.Clear();
+ //Clipboard.SetText( string.Format( "{0:X8}", instr.Address ) );
+
+ this.ContextReturn();
+ }
+
+ private void copyInstructionToolStripMenuItem_Click( object sender,
EventArgs e )
+ {
+ Instruction instr = this.GetContextInstruction();
+ if( instr == null )
+ return;
+
+ Clipboard.Clear();
+ //Clipboard.SetText( instr.ToString() );
+
+ this.ContextReturn();
+ }
+
+ private void copyLineToolStripMenuItem_Click( object sender,
EventArgs e )
+ {
+ Instruction instr = this.GetContextInstruction();
+ if( instr == null )
+ return;
+
+ StringBuilder line = new StringBuilder();
+ StringBuilder html = new StringBuilder();
+
+ //string args = instr.GetOperandsString();
+
+ //line.AppendFormat( "[{0:X8}] {1:X8} {2} {3}",
+ // instr.Address, instr.Code, instr.Opcode.ToString(), args );
+ //html.AppendFormat( "[<b><font color=\"blue\">{0:X8}</font></b>]
<font color=\"grey\">{1:X8}</font> <b>{2}</b> {3}",
+ // instr.Address, instr.Code, instr.Opcode.ToString(), args );
+
+ Clipboard.Clear();
+ //Clipboard.SetText( line.ToString(), TextDataFormat.Html );
+ //Clipboard.SetText( html.ToString(), TextDataFormat.Text );
+
+ this.ContextReturn();
+ }
+
+ #endregion
+
+ #region Control
+
+ private void showNextToolStripMenuItem_Click( object sender,
EventArgs e )
+ {
+ Instruction instr = this.GetContextInstruction();
+ if( instr == null )
+ return;
+
+ this.SetAddress( _debugger.PC );
+ this.Focus();
+
+ this.ContextReturn();
+ }
+
+ private void runToCursorToolStripMenuItem_Click( object sender,
EventArgs e )
+ {
+ Instruction instr = this.GetContextInstruction();
+ if( instr == null )
+ return;
+
+ this.ContextReturn();
+ }
+
+ private void setNextToolStripMenuItem_Click( object sender,
EventArgs e )
+ {
+ Instruction instr = this.GetContextInstruction();
+ if( instr == null )
+ return;
+
+ this.ContextReturn();
+ }
+
+ #endregion
+
+ #endregion
+
+ private void ContextReturn()
+ {
+ this.Invalidate();
+ _contextIndex = -1;
+ _contextOperand = null;
+ }
+
+ private void GeneralContextClosed( object sender,
ToolStripDropDownClosedEventArgs e )
+ {
+ if( e.CloseReason != ToolStripDropDownCloseReason.ItemClicked )
+ this.ContextReturn();
}

#endregion

Added: trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeViewControl.resx
==============================================================================
--- (empty file)
+++ trunk/Noxa.Emulation.Psp.Player/Debugger/Tools/CodeViewControl.resx
Sun Mar 23 11:45:56 2008
@@ -0,0 +1,132 @@
+<?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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="toolTip.TrayLocation" type="System.Drawing.Point,
System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 56</value>
+ </metadata>
+ <metadata name="lineContextMenuStrip.TrayLocation"
type="System.Drawing.Point, System.Drawing, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 95</value>
+ </metadata>
+ <metadata name="gutterContextMenuStrip.TrayLocation"
type="System.Drawing.Point, System.Drawing, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>468, 134</value>
+ </metadata>
+ <metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>False</value>
+ </metadata>
+</root>
\ No newline at end of file

Modified: trunk/Noxa.Emulation.Psp.Player/Noxa.Emulation.Psp.Player.csproj
==============================================================================
--- trunk/Noxa.Emulation.Psp.Player/Noxa.Emulation.Psp.Player.csproj (original)
+++ trunk/Noxa.Emulation.Psp.Player/Noxa.Emulation.Psp.Player.csproj
Sun Mar 23 11:45:56 2008
@@ -283,6 +283,10 @@
<DependentUpon>CodeTool.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
+ <EmbeddedResource Include="Debugger\Tools\CodeViewControl.resx">
+ <DependentUpon>CodeViewControl.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
<EmbeddedResource Include="Debugger\Tools\DisassemblyControl.resx">
<DependentUpon>DisassemblyControl.cs</DependentUpon>
<SubType>Designer</SubType>

Modified: trunk/Noxa.Emulation.Psp/Debugging/Protocol/IDebugger.cs
==============================================================================
--- trunk/Noxa.Emulation.Psp/Debugging/Protocol/IDebugger.cs (original)
+++ trunk/Noxa.Emulation.Psp/Debugging/Protocol/IDebugger.cs Sun Mar 23
11:45:56 2008
@@ -49,6 +49,12 @@
void OnStopped();

/// <summary>
+ /// Fired when the boot module is loaded.
+ /// </summary>
+ /// <param name="entryAddress">The entry address for the module.</param>
+ void OnBootModuleLoaded( uint entryAddress );
+
+ /// <summary>
/// Fired when a module is loaded.
/// </summary>
void OnModuleLoaded();

Reply all
Reply to author
Forward
0 new messages