limits on label length and comment length, and follow DR registers via dblclick (#1301)
This commit is contained in:
parent
0d27aeb160
commit
f6b82cf79e
|
@ -377,8 +377,6 @@ bool CapstoneTokenizer::tokenizeMnemonic()
|
|||
_mnemonicType = TokenType::MnemonicNop;
|
||||
else if(_cp.InGroup(CS_GRP_CALL))
|
||||
_mnemonicType = TokenType::MnemonicCall;
|
||||
else if(_cp.InGroup(CS_GRP_RET))
|
||||
_mnemonicType = TokenType::MnemonicRet;
|
||||
else if(_cp.InGroup(CS_GRP_JUMP) || _cp.IsLoop())
|
||||
{
|
||||
switch(id)
|
||||
|
@ -396,6 +394,8 @@ bool CapstoneTokenizer::tokenizeMnemonic()
|
|||
_mnemonicType = TokenType::MnemonicInt3;
|
||||
else if(_cp.IsUnusual())
|
||||
_mnemonicType = TokenType::MnemonicUnusual;
|
||||
else if(_cp.InGroup(CS_GRP_RET))
|
||||
_mnemonicType = TokenType::MnemonicRet;
|
||||
else
|
||||
{
|
||||
switch(id)
|
||||
|
|
|
@ -823,6 +823,7 @@ void CPUDisassembly::setLabelSlot()
|
|||
if(DbgGetLabelAt((duint)wVA, SEG_DEFAULT, label_text))
|
||||
mLineEdit.setText(QString(label_text));
|
||||
mLineEdit.setWindowTitle(tr("Add label at ") + addr_text);
|
||||
mLineEdit.setTextMaxLength(MAX_LABEL_SIZE - 2);
|
||||
if(mLineEdit.exec() != QDialog::Accepted)
|
||||
return;
|
||||
if(!DbgSetLabelAt(wVA, mLineEdit.editText.toUtf8().constData()))
|
||||
|
@ -876,6 +877,7 @@ void CPUDisassembly::setCommentSlot()
|
|||
mLineEdit.setText(QString(comment_text));
|
||||
}
|
||||
mLineEdit.setWindowTitle(tr("Add comment at ") + addr_text);
|
||||
mLineEdit.setTextMaxLength(MAX_COMMENT_SIZE - 2);
|
||||
if(mLineEdit.exec() != QDialog::Accepted)
|
||||
return;
|
||||
if(!DbgSetCommentAt(wVA, mLineEdit.editText.replace('\r', "").replace('\n', "").toUtf8().constData()))
|
||||
|
|
|
@ -427,10 +427,11 @@ void CPUDump::setLabelSlot()
|
|||
duint wVA = rvaToVa(getSelectionStart());
|
||||
LineEditDialog mLineEdit(this);
|
||||
QString addr_text = ToPtrString(wVA);
|
||||
char label_text[MAX_COMMENT_SIZE] = "";
|
||||
char label_text[MAX_LABEL_SIZE] = "";
|
||||
if(DbgGetLabelAt((duint)wVA, SEG_DEFAULT, label_text))
|
||||
mLineEdit.setText(QString(label_text));
|
||||
mLineEdit.setWindowTitle(tr("Add label at ") + addr_text);
|
||||
mLineEdit.setTextMaxLength(MAX_LABEL_SIZE - 2);
|
||||
if(mLineEdit.exec() != QDialog::Accepted)
|
||||
return;
|
||||
if(!DbgSetLabelAt(wVA, mLineEdit.editText.toUtf8().constData()))
|
||||
|
|
|
@ -1645,6 +1645,7 @@ void DisassemblerGraphView::setCommentSlot()
|
|||
}
|
||||
|
||||
mLineEdit.setWindowTitle(tr("Add comment at ") + addr_text);
|
||||
mLineEdit.setTextMaxLength(MAX_COMMENT_SIZE - 2);
|
||||
|
||||
if(mLineEdit.exec() != QDialog::Accepted)
|
||||
return;
|
||||
|
@ -1660,12 +1661,13 @@ void DisassemblerGraphView::setLabelSlot()
|
|||
duint wVA = this->get_cursor_pos();
|
||||
LineEditDialog mLineEdit(this);
|
||||
QString addr_text = ToPtrString(wVA);
|
||||
char label_text[MAX_COMMENT_SIZE] = "";
|
||||
char label_text[MAX_LABEL_SIZE] = "";
|
||||
|
||||
if(DbgGetLabelAt((duint)wVA, SEG_DEFAULT, label_text))
|
||||
mLineEdit.setText(QString(label_text));
|
||||
|
||||
mLineEdit.setWindowTitle(tr("Add label at ") + addr_text);
|
||||
mLineEdit.setTextMaxLength(MAX_LABEL_SIZE - 2);
|
||||
|
||||
if(mLineEdit.exec() != QDialog::Accepted)
|
||||
return;
|
||||
|
|
|
@ -89,3 +89,8 @@ void LineEditDialog::on_checkBox_toggled(bool checked)
|
|||
{
|
||||
bChecked = checked;
|
||||
}
|
||||
|
||||
void LineEditDialog::setTextMaxLength(int length)
|
||||
{
|
||||
ui->textEdit->setMaxLength(length);
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ public:
|
|||
bool bChecked;
|
||||
void setText(const QString & text);
|
||||
void setPlaceholderText(const QString & text);
|
||||
void setTextMaxLength(int length);
|
||||
void enableCheckBox(bool bEnable);
|
||||
void setCheckBox(bool bSet);
|
||||
void setCheckBoxText(const QString & text);
|
||||
|
|
|
@ -1690,6 +1690,8 @@ void RegistersView::mouseDoubleClickEvent(QMouseEvent* event)
|
|||
wCM_Modify->trigger();
|
||||
else if(mBOOLDISPLAY.contains(mSelected)) // is flag ?
|
||||
wCM_ToggleValue->trigger();
|
||||
else if(mCANSTOREADDRESS.contains(mSelected))
|
||||
wCM_FollowInDisassembly->trigger();
|
||||
}
|
||||
|
||||
void RegistersView::paintEvent(QPaintEvent* event)
|
||||
|
|
Loading…
Reference in New Issue