- I've added some debugger features recently, but now that I've tested

wxWindows without debugger, I needed to add some more cases of
  #if BX_DEBUGGER to make it work.  It is certainly possible to
  handle such problems by always compiling in the debug dialogs but
  only instantiating them if debug support is compiled in, but I have
  chosen (for now) to put #if BX_DEBUGGER around things like this.
- modified: gui/wxdialog.h gui/wxdialog.cc
This commit is contained in:
Bryce Denney 2002-09-16 16:04:15 +00:00
parent ea78c59c8d
commit 39a6dfc935
2 changed files with 20 additions and 16 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////
// $Id: wxdialog.cc,v 1.36 2002-09-16 15:28:19 bdenney Exp $
// $Id: wxdialog.cc,v 1.37 2002-09-16 16:04:14 bdenney Exp $
/////////////////////////////////////////////////////////////////
//
// misc/wxdialog.cc
@ -1447,12 +1447,12 @@ void DebugLogDialog::Init()
Center ();
}
void DebugLogDialog::Execute()
void DebugLogDialog::Execute(bool clear)
{
// send to debugger
theFrame->DebugCommand (command->GetValue ());
// display what they typed on the log screen
command->Clear ();
if (clear) command->Clear ();
}
void DebugLogDialog::AppendCommand (const char *cmd)
@ -1460,6 +1460,16 @@ void DebugLogDialog::AppendCommand (const char *cmd)
log->AppendText (wxT(">>> "));
log->AppendText (wxString (cmd));
log->AppendText (wxT("\n"));
int n = log->GetLastPosition ();
if (n>0) n--;
log->ShowPosition (n);
}
void DebugLogDialog::AppendText (wxString text) {
log->AppendText (text);
int n = log->GetLastPosition ();
if (n>0) n--;
log->ShowPosition (n);
}
void DebugLogDialog::OnEvent(wxCommandEvent& event)
@ -1470,14 +1480,8 @@ void DebugLogDialog::OnEvent(wxCommandEvent& event)
case wxID_OK:
Show(FALSE);
break;
case ID_DebugCommand:
if (event.GetEventType() == wxEVT_COMMAND_ENTER) {
// fall through into ID_Execute case
} else {
break;
}
case ID_Execute:
Execute ();
case ID_Execute: // pressed execute button
Execute (false);
break;
default:
event.Skip ();
@ -1994,7 +1998,7 @@ CpuRegistersDialog::Init ()
for (i=0; i<CPU_REGS_MAX_FLAGS; i++) {
if (i<nflags) {
bx_param_c *param = SIM->get_param (flagid[i]);
flagsSizer->Add (new wxStaticText (this, -1, param->get_name ()));
flagsSizer->Add (new wxStaticText (this, -1, param->get_name ()), 0, wxALL|wxALIGN_CENTER, 4);
} else {
flagsSizer->Add (0, 0); // spacer
}

View File

@ -1,5 +1,5 @@
////////////////////////////////////////////////////////////////////
// $Id: wxdialog.h,v 1.32 2002-09-16 15:28:19 bdenney Exp $
// $Id: wxdialog.h,v 1.33 2002-09-16 16:04:15 bdenney Exp $
////////////////////////////////////////////////////////////////////
//
// wxWindows dialogs for Bochs
@ -610,12 +610,12 @@ public:
DebugLogDialog(wxWindow* parent, wxWindowID id);
void Init (); // called automatically by ShowModal()
void OnEvent (wxCommandEvent& event);
void OnEnterEvent (wxCommandEvent& event) { Execute(); }
void OnEnterEvent (wxCommandEvent& event) { Execute(true); }
void OnKeyEvent (wxKeyEvent& event);
int ShowModal() { Init(); return wxDialog::ShowModal(); }
void Execute ();
void Execute (bool clearCommand);
void AppendCommand (const char *);
void AppendText (wxString text) { log->AppendText (text); }
void AppendText (wxString text);
DECLARE_EVENT_TABLE()
};