Add seek to PC and change PC menu functions to debugger.
This commit is contained in:
parent
aa02836972
commit
cae2d15e47
|
@ -93,7 +93,8 @@ ConsoleDebugger::ConsoleDebugger(QWidget *parent)
|
||||||
QFrame *frame;
|
QFrame *frame;
|
||||||
QLabel *lbl;
|
QLabel *lbl;
|
||||||
QMenuBar *menuBar;
|
QMenuBar *menuBar;
|
||||||
QMenu *fileMenu, *debugMenu, *optMenu, *symMenu, *subMenu;
|
QMenu *fileMenu, *viewMenu, *debugMenu,
|
||||||
|
*optMenu, *symMenu, *subMenu;
|
||||||
QActionGroup *actGroup;
|
QActionGroup *actGroup;
|
||||||
QAction *act;
|
QAction *act;
|
||||||
float fontCharWidth;
|
float fontCharWidth;
|
||||||
|
@ -127,16 +128,6 @@ ConsoleDebugger::ConsoleDebugger(QWidget *parent)
|
||||||
// File
|
// File
|
||||||
fileMenu = menuBar->addMenu(tr("&File"));
|
fileMenu = menuBar->addMenu(tr("&File"));
|
||||||
|
|
||||||
// File -> Go to Address
|
|
||||||
act = new QAction(tr("&Go to Address"), this);
|
|
||||||
act->setShortcut( QKeySequence(tr("Ctrl+A") ));
|
|
||||||
act->setStatusTip(tr("&Go to Address"));
|
|
||||||
//act->setIcon( QIcon(":icons/find.png") );
|
|
||||||
act->setIcon( QIcon(":icons/JumpTarget.png") );
|
|
||||||
connect(act, SIGNAL(triggered()), this, SLOT(openGotoAddrDialog(void)) );
|
|
||||||
|
|
||||||
fileMenu->addAction(act);
|
|
||||||
|
|
||||||
// File -> Close
|
// File -> Close
|
||||||
act = new QAction(tr("&Close"), this);
|
act = new QAction(tr("&Close"), this);
|
||||||
act->setShortcut(QKeySequence::Close);
|
act->setShortcut(QKeySequence::Close);
|
||||||
|
@ -145,6 +136,37 @@ ConsoleDebugger::ConsoleDebugger(QWidget *parent)
|
||||||
|
|
||||||
fileMenu->addAction(act);
|
fileMenu->addAction(act);
|
||||||
|
|
||||||
|
// View
|
||||||
|
viewMenu = menuBar->addMenu(tr("&View"));
|
||||||
|
|
||||||
|
// View -> Go to Address
|
||||||
|
act = new QAction(tr("&Go to Address"), this);
|
||||||
|
act->setShortcut( QKeySequence(tr("Ctrl+A") ));
|
||||||
|
act->setStatusTip(tr("&Go to Address"));
|
||||||
|
//act->setIcon( QIcon(":icons/find.png") );
|
||||||
|
act->setIcon( QIcon(":icons/JumpTarget.png") );
|
||||||
|
connect(act, SIGNAL(triggered()), this, SLOT(openGotoAddrDialog(void)) );
|
||||||
|
|
||||||
|
viewMenu->addAction(act);
|
||||||
|
|
||||||
|
// View -> Go to PC
|
||||||
|
act = new QAction(tr("Go to &PC"), this);
|
||||||
|
act->setShortcut( QKeySequence(tr("Ctrl+P") ));
|
||||||
|
act->setStatusTip(tr("Go to &PC"));
|
||||||
|
//act->setIcon( QIcon(":icons/JumpTarget.png") );
|
||||||
|
connect(act, SIGNAL(triggered()), this, SLOT(seekPCCB(void)) );
|
||||||
|
|
||||||
|
viewMenu->addAction(act);
|
||||||
|
|
||||||
|
// View -> Change PC
|
||||||
|
act = new QAction(tr("&Change PC"), this);
|
||||||
|
act->setShortcut( QKeySequence(tr("Ctrl+Shift+P") ));
|
||||||
|
act->setStatusTip(tr("&Change PC"));
|
||||||
|
//act->setIcon( QIcon(":icons/JumpTarget.png") );
|
||||||
|
connect(act, SIGNAL(triggered()), this, SLOT(openChangePcDialog(void)) );
|
||||||
|
|
||||||
|
viewMenu->addAction(act);
|
||||||
|
|
||||||
// Debug
|
// Debug
|
||||||
debugMenu = menuBar->addMenu(tr("&Debug"));
|
debugMenu = menuBar->addMenu(tr("&Debug"));
|
||||||
|
|
||||||
|
@ -1915,6 +1937,61 @@ void ConsoleDebugger::seekPCCB (void)
|
||||||
//asmView->scrollToPC();
|
//asmView->scrollToPC();
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
void ConsoleDebugger::openChangePcDialog(void)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
QDialog dialog(this);
|
||||||
|
QLabel *lbl;
|
||||||
|
QSpinBox *sbox;
|
||||||
|
QVBoxLayout *vbox;
|
||||||
|
QHBoxLayout *hbox;
|
||||||
|
QPushButton *okButton, *cancelButton;
|
||||||
|
|
||||||
|
vbox = new QVBoxLayout();
|
||||||
|
hbox = new QHBoxLayout();
|
||||||
|
lbl = new QLabel( tr("Specify Address [ 0x0000 -> 0xFFFF ]") );
|
||||||
|
|
||||||
|
okButton = new QPushButton( tr("Go") );
|
||||||
|
cancelButton = new QPushButton( tr("Cancel") );
|
||||||
|
|
||||||
|
okButton->setIcon( style()->standardIcon( QStyle::SP_DialogApplyButton ) );
|
||||||
|
cancelButton->setIcon( style()->standardIcon( QStyle::SP_DialogCancelButton ) );
|
||||||
|
|
||||||
|
connect( okButton, SIGNAL(clicked(void)), &dialog, SLOT(accept(void)) );
|
||||||
|
connect( cancelButton, SIGNAL(clicked(void)), &dialog, SLOT(reject(void)) );
|
||||||
|
|
||||||
|
sbox = new QSpinBox();
|
||||||
|
sbox->setRange(0x0000, 0xFFFF);
|
||||||
|
sbox->setDisplayIntegerBase(16);
|
||||||
|
sbox->setValue( X.PC );
|
||||||
|
|
||||||
|
QFont font = sbox->font();
|
||||||
|
font.setCapitalization(QFont::AllUppercase);
|
||||||
|
sbox->setFont(font);
|
||||||
|
|
||||||
|
hbox->addWidget( cancelButton );
|
||||||
|
hbox->addWidget( okButton );
|
||||||
|
|
||||||
|
vbox->addWidget( lbl );
|
||||||
|
vbox->addWidget( sbox );
|
||||||
|
vbox->addLayout( hbox );
|
||||||
|
|
||||||
|
dialog.setLayout( vbox );
|
||||||
|
|
||||||
|
dialog.setWindowTitle( tr("Change Program Counter") );
|
||||||
|
|
||||||
|
okButton->setDefault(true);
|
||||||
|
|
||||||
|
ret = dialog.exec();
|
||||||
|
|
||||||
|
if ( QDialog::Accepted == ret )
|
||||||
|
{
|
||||||
|
X.PC = sbox->value();
|
||||||
|
|
||||||
|
windowUpdateReq = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
void ConsoleDebugger::openGotoAddrDialog(void)
|
void ConsoleDebugger::openGotoAddrDialog(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
|
@ -306,6 +306,7 @@ class ConsoleDebugger : public QDialog
|
||||||
void debugRunLineCB(void);
|
void debugRunLineCB(void);
|
||||||
void debugRunLine128CB(void);
|
void debugRunLine128CB(void);
|
||||||
void openGotoAddrDialog(void);
|
void openGotoAddrDialog(void);
|
||||||
|
void openChangePcDialog(void);
|
||||||
void seekToCB(void);
|
void seekToCB(void);
|
||||||
void seekPCCB(void);
|
void seekPCCB(void);
|
||||||
void add_BP_CB(void);
|
void add_BP_CB(void);
|
||||||
|
|
Loading…
Reference in New Issue