Removed old commented out method in Qt debugger.
This commit is contained in:
parent
259c5754ee
commit
8649a38ef9
|
@ -2218,305 +2218,6 @@ void ConsoleDebugger::openBpEditWindow( int editIdx, watchpointinfo *wp, bool fo
|
|||
bpListUpdate( false );
|
||||
}
|
||||
}
|
||||
/*
|
||||
void ConsoleDebugger::openBpEditWindow( int editIdx, watchpointinfo *wp, bool forceAccept )
|
||||
{
|
||||
int ret;
|
||||
QDialog dialog(this);
|
||||
QHBoxLayout *hbox;
|
||||
QVBoxLayout *mainLayout, *vbox;
|
||||
QLabel *lbl;
|
||||
QLineEdit *addr1, *addr2, *cond, *name;
|
||||
QCheckBox *forbidChkBox, *rbp, *wbp, *xbp, *ebp;
|
||||
QGridLayout *grid;
|
||||
QFrame *frame;
|
||||
QGroupBox *gbox;
|
||||
QPushButton *okButton, *cancelButton;
|
||||
QRadioButton *cpu_radio, *ppu_radio, *oam_radio, *rom_radio;
|
||||
|
||||
if ( editIdx >= 0 )
|
||||
{
|
||||
dialog.setWindowTitle( tr("Edit Breakpoint") );
|
||||
}
|
||||
else
|
||||
{
|
||||
dialog.setWindowTitle( tr("Add Breakpoint") );
|
||||
}
|
||||
|
||||
hbox = new QHBoxLayout();
|
||||
mainLayout = new QVBoxLayout();
|
||||
|
||||
mainLayout->addLayout( hbox );
|
||||
|
||||
lbl = new QLabel( tr("Address") );
|
||||
addr1 = new QLineEdit();
|
||||
|
||||
hbox->addWidget( lbl );
|
||||
hbox->addWidget( addr1 );
|
||||
|
||||
lbl = new QLabel( tr("-") );
|
||||
addr2 = new QLineEdit();
|
||||
hbox->addWidget( lbl );
|
||||
hbox->addWidget( addr2 );
|
||||
|
||||
forbidChkBox = new QCheckBox( tr("Forbid") );
|
||||
hbox->addWidget( forbidChkBox );
|
||||
|
||||
frame = new QFrame();
|
||||
vbox = new QVBoxLayout();
|
||||
hbox = new QHBoxLayout();
|
||||
gbox = new QGroupBox();
|
||||
|
||||
rbp = new QCheckBox( tr("Read") );
|
||||
wbp = new QCheckBox( tr("Write") );
|
||||
xbp = new QCheckBox( tr("Execute") );
|
||||
ebp = new QCheckBox( tr("Enable") );
|
||||
|
||||
gbox->setTitle( tr("Memory") );
|
||||
mainLayout->addWidget( frame );
|
||||
frame->setLayout( vbox );
|
||||
frame->setFrameShape( QFrame::Box );
|
||||
vbox->addLayout( hbox );
|
||||
vbox->addWidget( gbox );
|
||||
|
||||
hbox->addWidget( rbp );
|
||||
hbox->addWidget( wbp );
|
||||
hbox->addWidget( xbp );
|
||||
hbox->addWidget( ebp );
|
||||
|
||||
hbox = new QHBoxLayout();
|
||||
cpu_radio = new QRadioButton( tr("CPU") );
|
||||
ppu_radio = new QRadioButton( tr("PPU") );
|
||||
oam_radio = new QRadioButton( tr("OAM") );
|
||||
rom_radio = new QRadioButton( tr("ROM") );
|
||||
cpu_radio->setChecked(true);
|
||||
|
||||
gbox->setLayout( hbox );
|
||||
hbox->addWidget( cpu_radio );
|
||||
hbox->addWidget( ppu_radio );
|
||||
hbox->addWidget( oam_radio );
|
||||
hbox->addWidget( rom_radio );
|
||||
|
||||
grid = new QGridLayout();
|
||||
|
||||
mainLayout->addLayout( grid );
|
||||
lbl = new QLabel( tr("Condition") );
|
||||
cond = new QLineEdit();
|
||||
|
||||
grid->addWidget( lbl, 0, 0 );
|
||||
grid->addWidget( cond, 0, 1 );
|
||||
|
||||
lbl = new QLabel( tr("Name") );
|
||||
name = new QLineEdit();
|
||||
|
||||
grid->addWidget( lbl, 1, 0 );
|
||||
grid->addWidget( name, 1, 1 );
|
||||
|
||||
hbox = new QHBoxLayout();
|
||||
okButton = new QPushButton( tr("OK") );
|
||||
cancelButton = new QPushButton( tr("Cancel") );
|
||||
|
||||
mainLayout->addLayout( hbox );
|
||||
hbox->addWidget( cancelButton );
|
||||
hbox->addWidget( okButton );
|
||||
|
||||
connect( okButton, SIGNAL(clicked(void)), &dialog, SLOT(accept(void)) );
|
||||
connect( cancelButton, SIGNAL(clicked(void)), &dialog, SLOT(reject(void)) );
|
||||
|
||||
okButton->setIcon( style()->standardIcon( QStyle::SP_DialogOkButton ) );
|
||||
cancelButton->setIcon( style()->standardIcon( QStyle::SP_DialogCancelButton ) );
|
||||
|
||||
okButton->setDefault(true);
|
||||
|
||||
if ( wp != NULL )
|
||||
{
|
||||
char stmp[256];
|
||||
|
||||
if ( wp->flags & BT_P )
|
||||
{
|
||||
ppu_radio->setChecked(true);
|
||||
}
|
||||
else if ( wp->flags & BT_S )
|
||||
{
|
||||
oam_radio->setChecked(true);
|
||||
}
|
||||
else if ( wp->flags & BT_R )
|
||||
{
|
||||
rom_radio->setChecked(true);
|
||||
}
|
||||
|
||||
sprintf( stmp, "%04X", wp->address );
|
||||
|
||||
addr1->setText( tr(stmp) );
|
||||
|
||||
if ( wp->endaddress > 0 )
|
||||
{
|
||||
sprintf( stmp, "%04X", wp->endaddress );
|
||||
|
||||
addr2->setText( tr(stmp) );
|
||||
}
|
||||
|
||||
if ( wp->flags & WP_R )
|
||||
{
|
||||
rbp->setChecked(true);
|
||||
}
|
||||
if ( wp->flags & WP_W )
|
||||
{
|
||||
wbp->setChecked(true);
|
||||
}
|
||||
if ( wp->flags & WP_X )
|
||||
{
|
||||
xbp->setChecked(true);
|
||||
}
|
||||
if ( wp->flags & WP_F )
|
||||
{
|
||||
forbidChkBox->setChecked(true);
|
||||
}
|
||||
if ( wp->flags & WP_E )
|
||||
{
|
||||
ebp->setChecked(true);
|
||||
}
|
||||
|
||||
if ( wp->condText )
|
||||
{
|
||||
cond->setText( tr(wp->condText) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( editIdx < 0 )
|
||||
{
|
||||
// If new breakpoint, default enable checkbox to true
|
||||
ebp->setChecked(true);
|
||||
|
||||
// If new breakpoint, suggest condition if in ROM Mapping area of memory.
|
||||
if ( cpu_radio->isChecked() && (wp->address >= 0x8000) )
|
||||
{
|
||||
int romAddr = GetNesFileAddress(wp->address);
|
||||
|
||||
if ( romAddr >= 0 )
|
||||
{
|
||||
wp->address = romAddr;
|
||||
sprintf( stmp, "%X", wp->address );
|
||||
addr1->setText( tr(stmp) );
|
||||
rom_radio->setChecked(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
char str[64];
|
||||
sprintf(str, "K==#%02X", getBank(wp->address));
|
||||
cond->setText( tr(str) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( wp->desc )
|
||||
{
|
||||
name->setText( tr(wp->desc) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// If new breakpoint, default enable checkbox to true
|
||||
ebp->setChecked(true);
|
||||
}
|
||||
|
||||
dialog.setLayout( mainLayout );
|
||||
|
||||
if ( forceAccept )
|
||||
{
|
||||
ret = QDialog::Accepted;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = dialog.exec();
|
||||
}
|
||||
|
||||
if ( ret == QDialog::Accepted )
|
||||
{
|
||||
int start_addr = -1, end_addr = -1, type = 0, enable = 1, slot;
|
||||
std::string s;
|
||||
|
||||
slot = (editIdx < 0) ? numWPs : editIdx;
|
||||
|
||||
if ( cpu_radio->isChecked() )
|
||||
{
|
||||
type |= BT_C;
|
||||
}
|
||||
else if ( ppu_radio->isChecked() )
|
||||
{
|
||||
type |= BT_P;
|
||||
}
|
||||
else if ( oam_radio->isChecked() )
|
||||
{
|
||||
type |= BT_S;
|
||||
}
|
||||
else if ( rom_radio->isChecked() )
|
||||
{
|
||||
type |= BT_R;
|
||||
}
|
||||
|
||||
s = addr1->text().toStdString();
|
||||
|
||||
if ( s.size() > 0 )
|
||||
{
|
||||
start_addr = offsetStringToInt( type, s.c_str() );
|
||||
}
|
||||
|
||||
s = addr2->text().toStdString();
|
||||
|
||||
if ( s.size() > 0 )
|
||||
{
|
||||
end_addr = offsetStringToInt( type, s.c_str() );
|
||||
}
|
||||
|
||||
if ( rbp->isChecked() )
|
||||
{
|
||||
type |= WP_R;
|
||||
}
|
||||
if ( wbp->isChecked() )
|
||||
{
|
||||
type |= WP_W;
|
||||
}
|
||||
if ( xbp->isChecked() )
|
||||
{
|
||||
type |= WP_X;
|
||||
}
|
||||
|
||||
if ( forbidChkBox->isChecked() )
|
||||
{
|
||||
type |= WP_F;
|
||||
}
|
||||
|
||||
enable = ebp->isChecked();
|
||||
|
||||
if ( (start_addr >= 0) && (numWPs < 64) )
|
||||
{
|
||||
unsigned int retval;
|
||||
std::string nameString, condString;
|
||||
|
||||
nameString = name->text().toStdString();
|
||||
condString = cond->text().toStdString();
|
||||
|
||||
retval = NewBreak( nameString.c_str(), start_addr, end_addr, type, condString.c_str(), slot, enable);
|
||||
|
||||
if ( (retval == 1) || (retval == 2) )
|
||||
{
|
||||
printf("Breakpoint Add Failed\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (editIdx < 0)
|
||||
{
|
||||
numWPs++;
|
||||
}
|
||||
|
||||
bpListUpdate( false );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
//----------------------------------------------------------------------------
|
||||
void ConsoleDebugger::openDebugSymbolEditWindow( int addr )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue