- add Debug Log dialog, which shows all the text output that is normally
printed to stderr in the text debugger. Also allows the user to type (text) debugger commands directly, which also appear in the log. - all text output in the debugger now passes through dbg_printf() (used to be fprintf to stderr) so that in wxWindows I can redirect it all to the wxWindows debug log screen. Added debug_fputs to siminterface which actually sends the text to the GUI by creating a BX_ASYNC_EVT_DBG_MSG event. - changed prefix and msg fields of BxLogMsgEvent to const char *, and also in args of logmsg method of siminterface. - don't trap SIGINT in wxWindows. There are other ways to stop execution. Also, signal handling with multiple threads is very strange and different on different platforms. - minor changes to fix gcc -Wall warnings in dbg_main.cc - add a new boolean parameter BXP_DEBUG_RUNNING that tells if the debugger is running freely or not. This is used by the wxWindows GUI to enable or disable certain choices. - CpuRegistersDialog has continue,stop,step buttons. When the sim is running freely, I disable continue and step, and enable stop. When the sim stops to wait for the user, I disable stop and enable continue and step. The change of enables used to be triggered by actually pressing the button, but then if you started/stopped the simulation in some other way (typing in debug log window) the enables were never changed. Now the enables are controlled by the value of BXP_DEBUG_RUNNING, which is set by the debug code itself, and the buttons are enabled at the right time. - ParamDialog::Refresh() is now virtual so that child classes can redefine its refresh behavior. - in safeWxStrcpy, force the last element of the array to be a 0, since I noticed that strncpy is not guaranteed to terminate the string! - modified: debug/dbg_main.cc debug/debug.h gui/siminterface.cc gui/siminterface.h gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h
This commit is contained in:
parent
d160c872b3
commit
bbae3335a2
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: debug.h,v 1.13 2002-09-14 19:21:41 kevinlawton Exp $
|
||||
// $Id: debug.h,v 1.14 2002-09-15 11:21:33 bdenney Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -187,7 +187,6 @@ typedef enum {
|
||||
|
||||
|
||||
|
||||
static void bx_debug_ctrlc_handler(int signum);
|
||||
void bx_debug_break ();
|
||||
|
||||
void bx_dbg_exit(int code);
|
||||
@ -197,6 +196,7 @@ void bx_dbg_exit(int code);
|
||||
#define bx_dbg_extensions(command) 0
|
||||
#endif
|
||||
|
||||
void dbg_printf (const char *fmt, ...);
|
||||
|
||||
//
|
||||
// code for guards...
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: siminterface.cc,v 1.58 2002-09-13 20:02:07 bdenney Exp $
|
||||
// $Id: siminterface.cc,v 1.59 2002-09-15 11:21:33 bdenney Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// See siminterface.h for description of the siminterface concept.
|
||||
@ -70,7 +70,7 @@ public:
|
||||
virtual char *get_floppy_type_name (int type);
|
||||
virtual void set_notify_callback (sim_interface_callback_t func, void *arg);
|
||||
virtual BxEvent* sim_to_ci_event (BxEvent *event);
|
||||
virtual int log_msg (const char *prefix, int level, char *msg);
|
||||
virtual int log_msg (const char *prefix, int level, const char *msg);
|
||||
virtual int ask_param (bx_id which);
|
||||
// ask the user for a pathname
|
||||
virtual int ask_filename (char *filename, int maxlen, char *prompt, char *the_default, int flags);
|
||||
@ -82,6 +82,7 @@ public:
|
||||
virtual void debug_break ();
|
||||
virtual void debug_interpret_cmd (char *cmd);
|
||||
virtual char *debug_get_next_command ();
|
||||
virtual void debug_fputs (const char *cmd);
|
||||
#endif
|
||||
};
|
||||
|
||||
@ -372,11 +373,11 @@ bx_real_sim_c::sim_to_ci_event (BxEvent *event)
|
||||
|
||||
// returns 0 for continue, 1 for alwayscontinue, 2 for die.
|
||||
int
|
||||
bx_real_sim_c::log_msg (const char *prefix, int level, char *msg)
|
||||
bx_real_sim_c::log_msg (const char *prefix, int level, const char *msg)
|
||||
{
|
||||
BxEvent *be = new BxEvent ();
|
||||
be->type = BX_SYNC_EVT_LOG_ASK;
|
||||
be->u.logmsg.prefix = (char *)prefix;
|
||||
be->u.logmsg.prefix = prefix;
|
||||
be->u.logmsg.level = level;
|
||||
be->u.logmsg.msg = msg;
|
||||
//fprintf (stderr, "calling notify.\n");
|
||||
@ -549,6 +550,14 @@ char *bx_real_sim_c::debug_get_next_command ()
|
||||
return event.u.debugcmd.command;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void bx_real_sim_c::debug_fputs (const char *cmd)
|
||||
{
|
||||
BxEvent *event = new BxEvent ();
|
||||
event->type = BX_ASYNC_EVT_DBG_MSG;
|
||||
event->u.logmsg.msg = cmd;
|
||||
sim_to_ci_event (event);
|
||||
}
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: siminterface.h,v 1.61 2002-09-13 19:39:38 bdenney Exp $
|
||||
// $Id: siminterface.h,v 1.62 2002-09-15 11:21:33 bdenney Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Before I can describe what this file is for, I have to make the
|
||||
@ -295,6 +295,9 @@ typedef enum {
|
||||
BXP_KBD_TIMER_PENDING,
|
||||
BXP_KBD_IRQ1_REQ,
|
||||
BXP_KBD_IRQ12_REQ,
|
||||
// in debugger, is the simulation running (continue command) or waiting.
|
||||
// This is only modified by debugger code, not by the user.
|
||||
BXP_DEBUG_RUNNING,
|
||||
BXP_THIS_IS_THE_LAST // used to determine length of list
|
||||
} bx_id;
|
||||
|
||||
@ -422,6 +425,7 @@ typedef enum {
|
||||
BX_ASYNC_EVT_MOUSE, // vga window -> simulator
|
||||
BX_ASYNC_EVT_SET_PARAM, // CI -> simulator
|
||||
BX_ASYNC_EVT_LOG_MSG, // simulator -> CI
|
||||
BX_ASYNC_EVT_DBG_MSG, // simulator -> CI
|
||||
BX_ASYNC_EVT_VALUE_CHANGED, // simulator -> CI
|
||||
BX_ASYNC_EVT_TOOLBAR, // CI -> simulator
|
||||
BX_ASYNC_EVT_REFRESH // simulator -> CI
|
||||
@ -533,10 +537,15 @@ typedef struct {
|
||||
// synchronizing threads, etc. for each.
|
||||
typedef struct {
|
||||
Bit8u level;
|
||||
char *prefix;
|
||||
char *msg;
|
||||
const char *prefix;
|
||||
const char *msg;
|
||||
} BxLogMsgEvent;
|
||||
|
||||
// Event type: BX_ASYNC_EVT_DBG_MSG (unused)
|
||||
//
|
||||
// Also uses BxLogMsgEvent, but this is a message to be displayed in
|
||||
// the debugger history window.
|
||||
|
||||
// Event type: BX_SYNC_EVT_LOG_ASK
|
||||
//
|
||||
// This is a synchronous version of BX_ASYNC_EVT_LOG_MSG, which is used
|
||||
@ -1013,7 +1022,7 @@ public:
|
||||
|
||||
// called from simulator when it hits serious errors, to ask if the user
|
||||
// wants to continue or not
|
||||
virtual int log_msg (const char *prefix, int level, char *msg) {return -1;}
|
||||
virtual int log_msg (const char *prefix, int level, const char *msg) {return -1;}
|
||||
|
||||
// tell the CI to ask the user for the value of a parameter.
|
||||
virtual int ask_param (bx_id param) {return -1;}
|
||||
@ -1032,6 +1041,7 @@ public:
|
||||
virtual void debug_break () {}
|
||||
virtual void debug_interpret_cmd (char *cmd) {}
|
||||
virtual char *debug_get_next_command () {return NULL;}
|
||||
virtual void debug_fputs (const char *cmd) {}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// $Id: wxdialog.cc,v 1.34 2002-09-13 22:03:05 bdenney Exp $
|
||||
// $Id: wxdialog.cc,v 1.35 2002-09-15 11:21:34 bdenney Exp $
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// misc/wxdialog.cc
|
||||
@ -1372,6 +1372,122 @@ void ConfigMemoryDialog::ShowHelp ()
|
||||
wxMessageBox(MSG_NO_HELP, MSG_NO_HELP_CAPTION, wxOK | wxICON_ERROR );
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// DebugLogDialog implementation
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Structure:
|
||||
// mainSizer:
|
||||
// wxTextCtrl log (multiline with vert scrollbar)
|
||||
// "Type a debugger command"
|
||||
// commandSizer:
|
||||
// wxTextCtrl command
|
||||
// Execute button
|
||||
// buttonSizer:
|
||||
// help
|
||||
// cancel
|
||||
// ok
|
||||
//
|
||||
|
||||
// all events go to OnEvent method
|
||||
BEGIN_EVENT_TABLE(DebugLogDialog, wxDialog)
|
||||
EVT_BUTTON(-1, DebugLogDialog::OnEvent)
|
||||
EVT_CHECKBOX(-1, DebugLogDialog::OnEvent)
|
||||
EVT_KEY_DOWN(DebugLogDialog::OnKeyEvent)
|
||||
EVT_KEY_UP(DebugLogDialog::OnKeyEvent)
|
||||
EVT_CHAR(DebugLogDialog::OnEvent)
|
||||
EVT_TEXT(-1, DebugLogDialog::OnEvent)
|
||||
EVT_TEXT_ENTER(-1, DebugLogDialog::OnEnterEvent)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
DebugLogDialog::DebugLogDialog(
|
||||
wxWindow* parent,
|
||||
wxWindowID id)
|
||||
: wxDialog (parent, id, "", wxDefaultPosition, wxDefaultSize,
|
||||
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
||||
{
|
||||
SetTitle (DEBUG_LOG_TITLE);
|
||||
mainSizer = new wxBoxSizer (wxVERTICAL);
|
||||
log = new wxTextCtrl (this, -1, "",
|
||||
wxDefaultPosition, wxSize(400, 300),
|
||||
wxTE_MULTILINE | wxTE_RICH | wxTE_READONLY);
|
||||
mainSizer->Add (log, 1, wxALL|wxGROW, 10);
|
||||
wxStaticText *text = new wxStaticText (this, -1, DEBUG_CMD_PROMPT);
|
||||
mainSizer->Add (text, 0, wxTOP|wxLEFT, 10);
|
||||
commandSizer = new wxBoxSizer (wxHORIZONTAL);
|
||||
mainSizer->Add (commandSizer, 0, wxALL|wxGROW, 5);
|
||||
buttonSizer = new wxBoxSizer (wxHORIZONTAL);
|
||||
mainSizer->Add (buttonSizer, 0, wxALIGN_RIGHT);
|
||||
|
||||
// commandSizer contents
|
||||
command = new wxTextCtrl (this, ID_DebugCommand, "",
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxTE_PROCESS_ENTER);
|
||||
commandSizer->Add (command, 1, wxGROW);
|
||||
wxButton *btn;
|
||||
btn = new wxButton (this, ID_Execute, BTNLABEL_EXECUTE);
|
||||
commandSizer->Add (btn, 0, wxALL, 5);
|
||||
|
||||
// buttonSizer contents
|
||||
btn = new wxButton (this, wxID_OK, BTNLABEL_CLOSE);
|
||||
buttonSizer->Add (btn, 0, wxALL, 5);
|
||||
}
|
||||
|
||||
void DebugLogDialog::Init()
|
||||
{
|
||||
// lay it out!
|
||||
SetAutoLayout(TRUE);
|
||||
SetSizer(mainSizer);
|
||||
mainSizer->Fit (this);
|
||||
wxSize size = mainSizer->GetMinSize ();
|
||||
wxLogMessage ("minsize is %d,%d", size.GetWidth(), size.GetHeight ());
|
||||
int margin = 5;
|
||||
SetSizeHints (size.GetWidth () + margin, size.GetHeight () + margin);
|
||||
Center ();
|
||||
}
|
||||
|
||||
void DebugLogDialog::Execute()
|
||||
{
|
||||
// send to debugger
|
||||
theFrame->DebugCommand (command->GetValue ());
|
||||
// display what they typed on the log screen
|
||||
command->Clear ();
|
||||
}
|
||||
|
||||
void DebugLogDialog::AppendCommand (const char *cmd)
|
||||
{
|
||||
log->AppendText (wxT(">>> "));
|
||||
log->AppendText (wxString (cmd));
|
||||
log->AppendText (wxT("\n"));
|
||||
}
|
||||
|
||||
void DebugLogDialog::OnEvent(wxCommandEvent& event)
|
||||
{
|
||||
int id = event.GetId ();
|
||||
wxLogMessage ("event was from id=%d, type=%d", id, (int)event.GetEventType ());
|
||||
switch (id) {
|
||||
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 ();
|
||||
break;
|
||||
default:
|
||||
event.Skip ();
|
||||
}
|
||||
}
|
||||
|
||||
void DebugLogDialog::OnKeyEvent(wxKeyEvent& event)
|
||||
{
|
||||
wxLogDebug ("key event");
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// ParamDialog
|
||||
/////////////////////////////////////////////////////////////////
|
||||
@ -1855,7 +1971,7 @@ CpuRegistersDialog::CpuRegistersDialog(
|
||||
stepButton = AddButton (ID_Debug_Step, BTNLABEL_DEBUG_STEP);
|
||||
//commitButton = AddButton (ID_Debug_Commit, BTNLABEL_DEBUG_COMMIT);
|
||||
#endif
|
||||
AddButton (ID_Close, BTNLABEL_DEBUG_CLOSE);
|
||||
AddButton (ID_Close, BTNLABEL_CLOSE);
|
||||
}
|
||||
|
||||
void
|
||||
@ -1905,6 +2021,13 @@ CpuRegistersDialog::stateChanged (bool simRunning)
|
||||
stopButton->Enable (simRunning);
|
||||
}
|
||||
|
||||
void
|
||||
CpuRegistersDialog::Refresh ()
|
||||
{
|
||||
ParamDialog::Refresh ();
|
||||
stateChanged (SIM->get_param_bool (BXP_DEBUG_RUNNING)->get ());
|
||||
}
|
||||
|
||||
// How am I going to communicate with the debugger?
|
||||
//
|
||||
// The current model is that the debugger asks you for a command, and
|
||||
@ -1940,11 +2063,9 @@ CpuRegistersDialog::OnEvent(wxCommandEvent& event)
|
||||
case ID_Debug_Stop:
|
||||
wxLogDebug ("wxWindows triggered a break");
|
||||
theFrame->DebugBreak ();
|
||||
stateChanged (false);
|
||||
break;
|
||||
case ID_Debug_Continue:
|
||||
theFrame->DebugCommand ("continue");
|
||||
stateChanged (true);
|
||||
break;
|
||||
case ID_Debug_Step:
|
||||
theFrame->DebugCommand ("step 1");
|
||||
|
@ -1,5 +1,5 @@
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// $Id: wxdialog.h,v 1.30 2002-09-13 22:03:05 bdenney Exp $
|
||||
// $Id: wxdialog.h,v 1.31 2002-09-15 11:21:34 bdenney Exp $
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// wxWindows dialogs for Bochs
|
||||
@ -22,7 +22,8 @@
|
||||
#define BTNLABEL_DEBUG_STOP "Stop"
|
||||
#define BTNLABEL_DEBUG_STEP "Step"
|
||||
#define BTNLABEL_DEBUG_COMMIT "Commit"
|
||||
#define BTNLABEL_DEBUG_CLOSE "Close"
|
||||
#define BTNLABEL_CLOSE "Close"
|
||||
#define BTNLABEL_EXECUTE "Execute"
|
||||
|
||||
#if defined(WIN32)
|
||||
// On win32, apparantly the spinctrl depends on a native control which only
|
||||
@ -575,6 +576,49 @@ public:
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// DebugLogDialog
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// DebugLogDialog allows the user to decide how Bochs will
|
||||
// behave for each type of log event.
|
||||
//
|
||||
// +---- Debugger log ---------------------------------------+
|
||||
// | |
|
||||
// | +--------------------------------------------------+ |
|
||||
// | |(0) f000:fff0: ea5be000f0: jmp f000:e05b | |
|
||||
// | |(0) 0010:00001868: 83fb10: cmp EBX, #10 | |
|
||||
// | | | |
|
||||
// | | | |
|
||||
// | | | |
|
||||
// | | | |
|
||||
// | +--------------------------------------------------+ |
|
||||
// | Type a debugger command: |
|
||||
// | +----------------------------------------+ +-------+ |
|
||||
// | | step 1000 | |Execute| |
|
||||
// | +----------------------------------------+ +-------+ |
|
||||
// | |
|
||||
// | [ Close ] |
|
||||
// +---------------------------------------------------------+
|
||||
class DebugLogDialog: public wxDialog
|
||||
{
|
||||
private:
|
||||
#define DEBUG_LOG_TITLE "Debugger log"
|
||||
#define DEBUG_CMD_PROMPT "Type a debugger command:"
|
||||
wxBoxSizer *mainSizer, *commandSizer, *buttonSizer;
|
||||
wxTextCtrl *log, *command;
|
||||
public:
|
||||
DebugLogDialog(wxWindow* parent, wxWindowID id);
|
||||
void Init (); // called automatically by ShowModal()
|
||||
void OnEvent (wxCommandEvent& event);
|
||||
void OnEnterEvent (wxCommandEvent& event) { Execute(); }
|
||||
void OnKeyEvent (wxKeyEvent& event);
|
||||
int ShowModal() { Init(); return wxDialog::ShowModal(); }
|
||||
void Execute ();
|
||||
void AppendCommand (const char *);
|
||||
void AppendText (wxString text) { log->AppendText (text); }
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// ConfigSoundDialog
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
@ -668,7 +712,7 @@ public:
|
||||
bool Show (bool val) { isShowing = val; return wxDialog::Show (val); }
|
||||
void AddParam (bx_param_c *param, wxFlexGridSizer *sizer = NULL, bool plain = false);
|
||||
void AddParamList (bx_id *idList, wxFlexGridSizer *sizer = NULL, bool plain = false);
|
||||
void Refresh ();
|
||||
virtual void Refresh ();
|
||||
bool IsShowing () { return isShowing; }
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
@ -762,10 +806,13 @@ public:
|
||||
int ShowModal() { Init(); return wxDialog::ShowModal(); }
|
||||
void AddFlag (bx_id paramId);
|
||||
void OnEvent (wxCommandEvent& event);
|
||||
virtual void Refresh ();
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
Everything else in here is a comment!
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// $Id: wxmain.cc,v 1.46 2002-09-13 21:53:37 bdenney Exp $
|
||||
// $Id: wxmain.cc,v 1.47 2002-09-15 11:21:34 bdenney Exp $
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// wxmain.cc implements the wxWindows frame, toolbar, menus, and dialogs.
|
||||
@ -177,6 +177,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
EVT_MENU(ID_Log_Prefs, MyFrame::OnLogPrefs)
|
||||
EVT_MENU(ID_Debug_ShowCpu, MyFrame::OnShowCpu)
|
||||
EVT_MENU(ID_Debug_ShowKeyboard, MyFrame::OnShowKeyboard)
|
||||
EVT_MENU(ID_Debug_Log, MyFrame::OnDebugLog)
|
||||
// toolbar events
|
||||
EVT_TOOL(ID_Edit_FD_0, MyFrame::OnToolbarClick)
|
||||
EVT_TOOL(ID_Edit_FD_1, MyFrame::OnToolbarClick)
|
||||
@ -294,6 +295,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
|
||||
menuDebug = new wxMenu;
|
||||
menuDebug->Append (ID_Debug_ShowCpu, "Show &CPU");
|
||||
menuDebug->Append (ID_Debug_ShowKeyboard, "Show &Keyboard");
|
||||
menuDebug->Append (ID_Debug_Log, "Show Log");
|
||||
menuDebug->Append (ID_Debug_ShowMemory, "Show &memory");
|
||||
|
||||
menuLog = new wxMenu;
|
||||
@ -354,6 +356,13 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
|
||||
SetSizer (sz);
|
||||
|
||||
thePanel = panel;
|
||||
|
||||
#if BX_DEBUGGER
|
||||
// create the debug log dialog box immediately so that we can write output
|
||||
// to it.
|
||||
showDebugLog = new DebugLogDialog (this, -1);
|
||||
showDebugLog->Init ();
|
||||
#endif
|
||||
}
|
||||
|
||||
MyFrame::~MyFrame ()
|
||||
@ -692,6 +701,13 @@ void MyFrame::OnShowKeyboard(wxCommandEvent& WXUNUSED(event))
|
||||
showKbd->Show (TRUE);
|
||||
}
|
||||
|
||||
void MyFrame::OnDebugLog(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxASSERT (showDebugLog != NULL);
|
||||
showDebugLog->Refresh ();
|
||||
showDebugLog->Show (TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
MyFrame::DebugBreak ()
|
||||
{
|
||||
@ -700,14 +716,26 @@ MyFrame::DebugBreak ()
|
||||
delete debugCommand;
|
||||
debugCommand = NULL;
|
||||
}
|
||||
wxASSERT (showDebugLog != NULL);
|
||||
showDebugLog->AppendCommand ("*** break ***");
|
||||
SIM->debug_break ();
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
MyFrame::DebugCommand (wxString cmd)
|
||||
{
|
||||
char buf[1024];
|
||||
safeWxStrcpy (buf, cmd, sizeof(buf));
|
||||
DebugCommand (buf);
|
||||
}
|
||||
|
||||
void
|
||||
MyFrame::DebugCommand (const char *cmd)
|
||||
{
|
||||
wxLogDebug ("debugger command: %s", cmd);
|
||||
wxASSERT (showDebugLog != NULL);
|
||||
showDebugLog->AppendCommand (cmd);
|
||||
if (debugCommand != NULL) {
|
||||
// one is already waiting
|
||||
wxLogDebug ("multiple debugger commands, discarding the earlier one");
|
||||
@ -1014,6 +1042,13 @@ MyFrame::OnSim2CIEvent (wxCommandEvent& event)
|
||||
sim_thread->SendSyncResponse(be);
|
||||
wxLogDebug ("after SendSyncResponse");
|
||||
return;
|
||||
case BX_ASYNC_EVT_DBG_MSG:
|
||||
showDebugLog->AppendText (be->u.logmsg.msg);
|
||||
// free the char* which was allocated in dbg_printf
|
||||
delete be->u.logmsg.msg;
|
||||
// free the whole event
|
||||
delete be;
|
||||
return;
|
||||
case BX_SYNC_EVT_LOG_ASK:
|
||||
case BX_ASYNC_EVT_LOG_MSG:
|
||||
{
|
||||
@ -1474,4 +1509,5 @@ safeWxStrcpy (char *dest, wxString src, int destlen)
|
||||
{
|
||||
wxString tmp (src);
|
||||
strncpy (dest, tmp.c_str (), destlen);
|
||||
dest[destlen-1] = 0;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// $Id: wxmain.h,v 1.22 2002-09-13 19:39:38 bdenney Exp $
|
||||
// $Id: wxmain.h,v 1.23 2002-09-15 11:21:35 bdenney Exp $
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// This file defines variables and classes that the wxWindows .cc files
|
||||
// share. It should be included only by wx.cc and wxmain.cc.
|
||||
@ -47,6 +47,7 @@ enum
|
||||
ID_Simulate_Speed,
|
||||
ID_Debug_ShowCpu,
|
||||
ID_Debug_ShowKeyboard,
|
||||
ID_Debug_Log,
|
||||
ID_Debug_ShowMemory,
|
||||
ID_Log_View,
|
||||
ID_Log_Prefs,
|
||||
@ -94,6 +95,8 @@ enum
|
||||
ID_Debug_Step,
|
||||
ID_Debug_Commit,
|
||||
ID_Close,
|
||||
ID_Execute,
|
||||
ID_DebugCommand,
|
||||
// that's all
|
||||
ID_LAST_USER_DEFINED
|
||||
};
|
||||
@ -173,7 +176,9 @@ public:
|
||||
void OnOtherEvent(wxCommandEvent& event);
|
||||
void OnShowCpu(wxCommandEvent& event);
|
||||
void OnShowKeyboard(wxCommandEvent& event);
|
||||
void OnDebugLog(wxCommandEvent& event);
|
||||
void DebugBreak ();
|
||||
void DebugCommand (wxString string);
|
||||
void DebugCommand (const char *cmd);
|
||||
static bool editFloppyValidate (FloppyConfigDialog *dialog);
|
||||
void editFloppyConfig (int drive);
|
||||
@ -198,6 +203,7 @@ private:
|
||||
wxMenu *menuLog;
|
||||
wxMenu *menuHelp;
|
||||
ParamDialog *showCpu, *showKbd;
|
||||
DebugLogDialog *showDebugLog;
|
||||
void RefreshDialogs ();
|
||||
char *debugCommand; // maybe need lock on this
|
||||
BxEvent *debugCommandEvent; // maybe need lock on this
|
||||
|
Loading…
Reference in New Issue
Block a user