Help button/window in debugger (Windows only)

This commit is contained in:
Kingcom 2014-02-22 11:22:29 +01:00
parent 30d5135fdd
commit 1f7d6461c5
5 changed files with 119 additions and 0 deletions

31
bin/docs/debugger.txt Normal file
View File

@ -0,0 +1,31 @@
disassembly view:
ctrg+g goto
ctrl+e edit breakpoint
ctrl+d enable/disable breakpoint
ctrl+b add breakpoint
right follow branch/position memory view to accessed address
left go back one branch level/goto pc
up move cursor up one line
down move cursor down one line
page up move visible area up one page
page down move visible area down one page
f10 step over
tab toggle display symbols
left click select line/toggle breakpoint if line is already highlighted
right click open context menu
memory view:
ctrg+g goto
ctrl+b add breakpoint
left move cursor back one byte/nibble
right move cursor ahead one byte/nibble
up move cursor up one line
down move cursor down one line
page up move cursor up one page
page down move cursor down one page
0-9,A-F overwrite hex nibble
any overwrite ansi byte
left click select byte/nibble
right click open context menu

View File

@ -63,6 +63,7 @@ namespace PathDefs
extern wxDirName GetLangs();
extern wxDirName GetCheats();
extern wxDirName GetCheatsWS();
extern wxDirName GetDocs();
extern wxDirName Get( FoldersEnum_t folderidx );
@ -81,6 +82,7 @@ namespace PathDefs
extern const wxDirName& Langs();
extern const wxDirName& Cheats();
extern const wxDirName& CheatsWS();
extern const wxDirName& Docs();
}
}

View File

@ -95,6 +95,12 @@ namespace PathDefs
static const wxDirName retval( L"themes" );
return retval;
}
const wxDirName& Docs()
{
static const wxDirName retval( L"docs" );
return retval;
}
};
// Specifies the root folder for the application install.
@ -190,6 +196,11 @@ namespace PathDefs
{
return GetDocuments() + Base::CheatsWS();
}
wxDirName GetDocs()
{
return AppRoot() + Base::Docs();
}
wxDirName GetSavestates()
{

View File

@ -5,6 +5,11 @@
#include "DebugTools/DisassemblyManager.h"
#include "DebugTools/Breakpoints.h"
#include "BreakpointWindow.h"
#include "PathDefs.h"
#ifdef WIN32
#include <Windows.h>
#endif
BEGIN_EVENT_TABLE(DisassemblyDialog, wxFrame)
EVT_COMMAND( wxID_ANY, debEVT_SETSTATUSBARTEXT, DisassemblyDialog::onDebuggerEvent )
@ -16,6 +21,34 @@ BEGIN_EVENT_TABLE(DisassemblyDialog, wxFrame)
EVT_COMMAND( wxID_ANY, debEVT_UPDATE, DisassemblyDialog::onDebuggerEvent )
END_EVENT_TABLE()
DebuggerHelpDialog::DebuggerHelpDialog(wxWindow* parent)
: wxDialog(parent,wxID_ANY,L"Help")
{
wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
wxTextCtrl* textControl = new wxTextCtrl(this,wxID_ANY,L"",wxDefaultPosition,wxDefaultSize,
wxTE_MULTILINE|wxTE_READONLY);
textControl->SetMinSize(wxSize(400,300));
auto fileName = PathDefs::GetDocs().ToString()+L"/debugger.txt";
wxTextFile file(fileName);
if (file.Open())
{
wxString text = file.GetFirstLine();
while (!file.Eof())
{
text += file.GetNextLine()+L"\r\n";
}
textControl->SetLabel(text);
textControl->SetSelection(0,0);
}
sizer->Add(textControl,1,wxEXPAND);
SetSizerAndFit(sizer);
}
CpuTabPage::CpuTabPage(wxWindow* parent, DebugInterface* _cpu)
: wxPanel(parent), cpu(_cpu)
{
@ -99,6 +132,38 @@ DisassemblyDialog::DisassemblyDialog(wxWindow* parent):
setDebugMode(true);
}
#ifdef WIN32
WXLRESULT DisassemblyDialog::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{
switch (nMsg)
{
case WM_SHOWWINDOW:
{
WXHWND hwnd = GetHWND();
u32 style = GetWindowLong((HWND)hwnd,GWL_STYLE);
style &= ~(WS_MINIMIZEBOX|WS_MAXIMIZEBOX);
SetWindowLong((HWND)hwnd,GWL_STYLE,style);
u32 exStyle = GetWindowLong((HWND)hwnd,GWL_EXSTYLE);
exStyle |= (WS_EX_CONTEXTHELP);
SetWindowLong((HWND)hwnd,GWL_EXSTYLE,exStyle);
}
break;
case WM_SYSCOMMAND:
if (wParam == SC_CONTEXTHELP)
{
DebuggerHelpDialog help(this);
help.ShowModal();
return 0;
}
break;
}
return wxFrame::MSWWindowProc(nMsg,wParam,lParam);
}
#endif
void DisassemblyDialog::onBreakRunClicked(wxCommandEvent& evt)
{
if (r5900Debug.isCpuPaused())

View File

@ -8,6 +8,12 @@
#include "CtrlMemView.h"
#include "DebugEvents.h"
class DebuggerHelpDialog: public wxDialog
{
public:
DebuggerHelpDialog(wxWindow* parent);
};
class CpuTabPage: public wxPanel
{
public:
@ -37,6 +43,10 @@ public:
void update();
void reset();
void setDebugMode(bool debugMode);
#ifdef WIN32
WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
#endif
DECLARE_EVENT_TABLE()
protected: