1
0
Fork 0

Fix when double-clicking on the dump when not debugging modify dialog would appear (#991)

This commit is contained in:
Torusrxxx 2016-08-18 12:08:03 +00:00 committed by Duncan Ogilvie
parent 091f1d5186
commit 7755b6c895
6 changed files with 24 additions and 12 deletions

View File

@ -185,7 +185,7 @@ QString HexDump::makeAddrText(duint va)
}
else
*label = 0;
return addrText;
return std::move(addrText);
}
QString HexDump::makeCopyText()
@ -214,7 +214,7 @@ QString HexDump::makeCopyText()
curRow += getBytePerRowCount();
result += "\n";
}
return result;
return std::move(result);
}
void HexDump::addVaToHistory(dsint parVa)

View File

@ -240,7 +240,7 @@ void ReferenceView::followDumpAddress()
void ReferenceView::followApiAddress()
{
dsint apiValue = apiAddressFromString(mCurList->getCellContent(mCurList->getInitialSelection(), 1));
DbgCmdExecDirect(QString("disasm " + QString().sprintf("%p", apiValue)).toUtf8().constData());
DbgCmdExecDirect(QString("disasm " + ToPtrString(apiValue)).toUtf8().constData());
emit showCpu();
}

View File

@ -1554,6 +1554,8 @@ void CPUDisassembly::editSoftBpActionSlot()
void CPUDisassembly::ActionTraceRecordBitSlot()
{
if(!DbgIsDebugging())
return;
duint base = mMemPage->getBase();
duint size = mMemPage->getSize();
for(duint i = base; i < base + size; i += 4096)
@ -1568,6 +1570,8 @@ void CPUDisassembly::ActionTraceRecordBitSlot()
void CPUDisassembly::ActionTraceRecordByteSlot()
{
if(!DbgIsDebugging())
return;
duint base = mMemPage->getBase();
duint size = mMemPage->getSize();
for(duint i = base; i < base + size; i += 4096)
@ -1582,6 +1586,8 @@ void CPUDisassembly::ActionTraceRecordByteSlot()
void CPUDisassembly::ActionTraceRecordWordSlot()
{
if(!DbgIsDebugging())
return;
duint base = mMemPage->getBase();
duint size = mMemPage->getSize();
for(duint i = base; i < base + size; i += 4096)
@ -1596,6 +1602,8 @@ void CPUDisassembly::ActionTraceRecordWordSlot()
void CPUDisassembly::ActionTraceRecordDisableSlot()
{
if(!DbgIsDebugging())
return;
duint base = mMemPage->getBase();
duint size = mMemPage->getSize();
for(duint i = base; i < base + size; i += 4096)
@ -1634,6 +1642,8 @@ void CPUDisassembly::analyzeSingleFunctionSlot()
void CPUDisassembly::removeAnalysisSelectionSlot()
{
if(!DbgIsDebugging())
return;
WordEditDialog mLineEdit(this);
mLineEdit.setup(tr("Size"), getSelectionSize(), sizeof(duint));
if(mLineEdit.exec() != QDialog::Accepted || !mLineEdit.getVal())
@ -1644,12 +1654,16 @@ void CPUDisassembly::removeAnalysisSelectionSlot()
void CPUDisassembly::removeAnalysisModuleSlot()
{
if(!DbgIsDebugging())
return;
mDisasm->getEncodeMap()->delSegment(rvaToVa(getSelectionStart()));
GuiUpdateDisassemblyView();
}
void CPUDisassembly::setEncodeTypeRangeSlot()
{
if(!DbgIsDebugging())
return;
QAction* pAction = qobject_cast<QAction*>(sender());
WordEditDialog mLineEdit(this);
mLineEdit.setup(tr("Size"), getSelectionSize(), sizeof(duint));
@ -1661,6 +1675,8 @@ void CPUDisassembly::setEncodeTypeRangeSlot()
void CPUDisassembly::setEncodeTypeSlot()
{
if(!DbgIsDebugging())
return;
QAction* pAction = qobject_cast<QAction*>(sender());
mDisasm->getEncodeMap()->setDataType(rvaToVa(getSelectionStart()), (ENCODETYPE)pAction->data().toUInt());
GuiUpdateDisassemblyView();

View File

@ -317,7 +317,7 @@ void CPUDump::contextMenuEvent(QContextMenuEvent* event)
void CPUDump::mouseDoubleClickEvent(QMouseEvent* event)
{
if(event->button() != Qt::LeftButton)
if(event->button() != Qt::LeftButton || !DbgIsDebugging())
return;
switch(getColumnIndexFromX(event->x()))
{

View File

@ -606,7 +606,7 @@ void CPUStack::contextMenuEvent(QContextMenuEvent* event)
void CPUStack::mouseDoubleClickEvent(QMouseEvent* event)
{
if(event->button() != Qt::LeftButton)
if(event->button() != Qt::LeftButton || !DbgIsDebugging())
return;
switch(getColumnIndexFromX(event->x()))
{

View File

@ -1880,7 +1880,7 @@ void RegistersView::ModifyFields(QString title, STRING_VALUE_TABLE_t* table, SIZ
setRegister(mSelected, (duint)value);
}
#define MODIFY_FIELDS_DISPLAY(title, table) ModifyFields(QString("Edit ") + QString(title), (STRING_VALUE_TABLE_t *) & table, SIZE_TABLE(table) )
#define MODIFY_FIELDS_DISPLAY(title, table) ModifyFields(tr("Edit") + QChar(' ') + QString(title), (STRING_VALUE_TABLE_t *) & table, SIZE_TABLE(table) )
/**
* @brief This function displays the appropriate edit dialog according to selected register
@ -1983,11 +1983,7 @@ void RegistersView::displayEditDialog()
{
errorinput = true;
QMessageBox msg(QMessageBox::Warning, tr("ERROR CONVERTING TO HEX"), tr("ERROR CONVERTING TO HEX"));
msg.setWindowIcon(DIcon("compile-warning.png"));
msg.setParent(this, Qt::Dialog);
msg.setWindowFlags(msg.windowFlags() & (~Qt::WindowContextHelpButtonHint));
msg.exec();
SimpleWarningBox(this, tr("ERROR CONVERTING TO HEX"), tr("ERROR CONVERTING TO HEX"));
}
else
setRegister(mSelected, fpuvalue);
@ -2000,7 +1996,7 @@ void RegistersView::displayEditDialog()
else
{
WordEditDialog wEditDial(this);
wEditDial.setup(QString("Edit"), (* ((duint*) registerValue(&wRegDumpStruct, mSelected))), sizeof(dsint));
wEditDial.setup(tr("Edit"), (* ((duint*) registerValue(&wRegDumpStruct, mSelected))), sizeof(dsint));
if(wEditDial.exec() == QDialog::Accepted) //OK button clicked
setRegister(mSelected, wEditDial.getVal());
}