Added goto address menu function for Qt debugger.
This commit is contained in:
parent
117bfd0223
commit
e9cb6498cd
|
@ -29,6 +29,7 @@
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include <QSpinBox>
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
|
@ -124,15 +125,11 @@ ConsoleDebugger::ConsoleDebugger(QWidget *parent)
|
||||||
// File
|
// File
|
||||||
fileMenu = menuBar->addMenu(tr("&File"));
|
fileMenu = menuBar->addMenu(tr("&File"));
|
||||||
|
|
||||||
// Symbols -> Load .DEB
|
// File -> Go to Address
|
||||||
g_config->getOption( "SDL.AutoLoadDebugFiles", &opt );
|
act = new QAction(tr("&Go to Address"), this);
|
||||||
|
act->setShortcut( QKeySequence(tr("Ctrl+A") ));
|
||||||
act = new QAction(tr("&Load .DEB on ROM Load"), this);
|
act->setStatusTip(tr("&Go to Address"));
|
||||||
//act->setShortcut(QKeySequence( tr("F7") ) );
|
connect(act, SIGNAL(triggered()), this, SLOT(openGotoAddrDialog(void)) );
|
||||||
act->setStatusTip(tr("&Load .DEB on ROM Load"));
|
|
||||||
act->setCheckable(true);
|
|
||||||
act->setChecked( opt ? true : false );
|
|
||||||
connect( act, SIGNAL(triggered(bool)), this, SLOT(debFileAutoLoadCB(bool)) );
|
|
||||||
|
|
||||||
fileMenu->addAction(act);
|
fileMenu->addAction(act);
|
||||||
|
|
||||||
|
@ -247,6 +244,32 @@ ConsoleDebugger::ConsoleDebugger(QWidget *parent)
|
||||||
// Options
|
// Options
|
||||||
optMenu = menuBar->addMenu(tr("&Options"));
|
optMenu = menuBar->addMenu(tr("&Options"));
|
||||||
|
|
||||||
|
// Options -> Open Debugger on ROM Load
|
||||||
|
g_config->getOption( "SDL.AutoOpenDebugger", &opt );
|
||||||
|
|
||||||
|
act = new QAction(tr("&Open Debugger on ROM Load"), this);
|
||||||
|
//act->setShortcut(QKeySequence( tr("F7") ) );
|
||||||
|
act->setStatusTip(tr("&Reload"));
|
||||||
|
act->setCheckable(true);
|
||||||
|
act->setChecked( opt ? true : false );
|
||||||
|
connect( act, SIGNAL(triggered(bool)), this, SLOT(autoOpenDebugCB(bool)) );
|
||||||
|
|
||||||
|
optMenu->addAction(act);
|
||||||
|
|
||||||
|
// Options -> Load .DEB
|
||||||
|
g_config->getOption( "SDL.AutoLoadDebugFiles", &opt );
|
||||||
|
|
||||||
|
act = new QAction(tr("&Load .DEB on ROM Load"), this);
|
||||||
|
//act->setShortcut(QKeySequence( tr("F7") ) );
|
||||||
|
act->setStatusTip(tr("&Load .DEB on ROM Load"));
|
||||||
|
act->setCheckable(true);
|
||||||
|
act->setChecked( opt ? true : false );
|
||||||
|
connect( act, SIGNAL(triggered(bool)), this, SLOT(debFileAutoLoadCB(bool)) );
|
||||||
|
|
||||||
|
optMenu->addAction(act);
|
||||||
|
|
||||||
|
optMenu->addSeparator();
|
||||||
|
|
||||||
// Options -> PC Position
|
// Options -> PC Position
|
||||||
subMenu = optMenu->addMenu(tr("&PC Line Positioning"));
|
subMenu = optMenu->addMenu(tr("&PC Line Positioning"));
|
||||||
actGroup = new QActionGroup(this);
|
actGroup = new QActionGroup(this);
|
||||||
|
@ -309,20 +332,6 @@ ConsoleDebugger::ConsoleDebugger(QWidget *parent)
|
||||||
actGroup->addAction(act);
|
actGroup->addAction(act);
|
||||||
subMenu->addAction(act);
|
subMenu->addAction(act);
|
||||||
|
|
||||||
optMenu->addSeparator();
|
|
||||||
|
|
||||||
// Options -> Open Debugger on ROM Load
|
|
||||||
g_config->getOption( "SDL.AutoOpenDebugger", &opt );
|
|
||||||
|
|
||||||
act = new QAction(tr("&Open Debugger on ROM Load"), this);
|
|
||||||
//act->setShortcut(QKeySequence( tr("F7") ) );
|
|
||||||
act->setStatusTip(tr("&Reload"));
|
|
||||||
act->setCheckable(true);
|
|
||||||
act->setChecked( opt ? true : false );
|
|
||||||
connect( act, SIGNAL(triggered(bool)), this, SLOT(autoOpenDebugCB(bool)) );
|
|
||||||
|
|
||||||
optMenu->addAction(act);
|
|
||||||
|
|
||||||
// Symbols
|
// Symbols
|
||||||
symMenu = menuBar->addMenu(tr("&Symbols"));
|
symMenu = menuBar->addMenu(tr("&Symbols"));
|
||||||
|
|
||||||
|
@ -675,7 +684,7 @@ ConsoleDebugger::ConsoleDebugger(QWidget *parent)
|
||||||
|
|
||||||
bmTree->setHeaderItem( item );
|
bmTree->setHeaderItem( item );
|
||||||
|
|
||||||
bmTree->header()->setSectionResizeMode( QHeaderView::ResizeToContents );
|
//bmTree->header()->setSectionResizeMode( QHeaderView::ResizeToContents );
|
||||||
|
|
||||||
connect( bmTree, SIGNAL(itemClicked(QTreeWidgetItem*, int)),
|
connect( bmTree, SIGNAL(itemClicked(QTreeWidgetItem*, int)),
|
||||||
this, SLOT(bmItemClicked( QTreeWidgetItem*, int)) );
|
this, SLOT(bmItemClicked( QTreeWidgetItem*, int)) );
|
||||||
|
@ -1799,6 +1808,63 @@ void ConsoleDebugger::seekPCCB (void)
|
||||||
//asmView->scrollToPC();
|
//asmView->scrollToPC();
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
void ConsoleDebugger::openGotoAddrDialog(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") );
|
||||||
|
|
||||||
|
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("Goto Address") );
|
||||||
|
|
||||||
|
okButton->setDefault(true);
|
||||||
|
|
||||||
|
ret = dialog.exec();
|
||||||
|
|
||||||
|
if ( QDialog::Accepted == ret )
|
||||||
|
{
|
||||||
|
int addr, line;
|
||||||
|
|
||||||
|
addr = sbox->value();
|
||||||
|
|
||||||
|
line = asmView->getAsmLineFromAddr(addr);
|
||||||
|
|
||||||
|
asmView->setLine( line );
|
||||||
|
vbar->setValue( line );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
void ConsoleDebugger::resetCountersCB (void)
|
void ConsoleDebugger::resetCountersCB (void)
|
||||||
{
|
{
|
||||||
ResetDebugStatisticsCounters();
|
ResetDebugStatisticsCounters();
|
||||||
|
@ -4113,7 +4179,7 @@ void QAsmView::paintEvent(QPaintEvent *event)
|
||||||
y += pxLineSpacing;
|
y += pxLineSpacing;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
l = (int)(2.5*pxCharWidth);
|
l = (int)(2.5*pxCharWidth) - pxLineXScroll;
|
||||||
pen = painter.pen();
|
pen = painter.pen();
|
||||||
pen.setWidth(3);
|
pen.setWidth(3);
|
||||||
pen.setColor( this->palette().color(QPalette::WindowText));
|
pen.setColor( this->palette().color(QPalette::WindowText));
|
||||||
|
|
|
@ -303,6 +303,7 @@ class ConsoleDebugger : public QDialog
|
||||||
void debugRunToCursorCB(void);
|
void debugRunToCursorCB(void);
|
||||||
void debugRunLineCB(void);
|
void debugRunLineCB(void);
|
||||||
void debugRunLine128CB(void);
|
void debugRunLine128CB(void);
|
||||||
|
void openGotoAddrDialog(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