GUI: fixed various bugs (thanks to Coverity)
This commit is contained in:
parent
5a214ab104
commit
38ff3a1393
|
|
@ -241,7 +241,7 @@ void AbstractTableView::mouseMoveEvent(QMouseEvent* event)
|
|||
bool bCanResize = (getColumnWidth(mColResizeData.index) + delta) >= 20;
|
||||
if(bCanResize)
|
||||
{
|
||||
int wNewSize = bCanResize ? (getColumnWidth(mColResizeData.index) + delta) : (20);
|
||||
int wNewSize = getColumnWidth(mColResizeData.index) + delta;
|
||||
setColumnWidth(mColResizeData.index, wNewSize);
|
||||
mColResizeData.lastPosX = event->x();
|
||||
repaint();
|
||||
|
|
@ -456,7 +456,7 @@ void AbstractTableView::keyPressEvent(QKeyEvent* event)
|
|||
*/
|
||||
void AbstractTableView::vertSliderActionSlot(int action)
|
||||
{
|
||||
int_t wDelta;
|
||||
int_t wDelta = 0;
|
||||
int wSliderPos = verticalScrollBar()->sliderPosition();
|
||||
int wNewScrollBarValue;
|
||||
|
||||
|
|
|
|||
|
|
@ -343,9 +343,6 @@ QString Disassembly::paintContent(QPainter* painter, int_t rowBase, int rowOffse
|
|||
Function_t funcType;
|
||||
switch(loopType)
|
||||
{
|
||||
case LOOP_NONE:
|
||||
funcType = Function_none;
|
||||
break;
|
||||
case LOOP_BEGIN:
|
||||
funcType = Function_start;
|
||||
break;
|
||||
|
|
@ -358,6 +355,8 @@ QString Disassembly::paintContent(QPainter* painter, int_t rowBase, int rowOffse
|
|||
case LOOP_END:
|
||||
funcType = Function_end;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
loopsize += paintFunctionGraphic(painter, x + loopsize, y, funcType, true);
|
||||
depth++;
|
||||
|
|
@ -1481,6 +1480,6 @@ QString Disassembly::getAddrText(int_t cur_addr, char label[MAX_LABEL_SIZE])
|
|||
else
|
||||
*label_ = 0;
|
||||
if(label)
|
||||
strcpy(label, label_);
|
||||
strcpy_s(label, MAX_LABEL_SIZE, label_);
|
||||
return addrText;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ HistoryLineEdit::HistoryLineEdit(QWidget* parent) : QLineEdit(parent)
|
|||
{
|
||||
mCmdHistory.clear();
|
||||
mCmdIndex = -1;
|
||||
bSixPressed = false;
|
||||
}
|
||||
|
||||
void HistoryLineEdit::addLineToHistory(QString parLine)
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
ShortcutEdit::ShortcutEdit(QWidget* parent) : QLineEdit(parent)
|
||||
{
|
||||
keyInt = -1;
|
||||
}
|
||||
|
||||
const QKeySequence ShortcutEdit::getKeysequence() const
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
class ShortcutEdit : public QLineEdit
|
||||
{
|
||||
Q_OBJECT
|
||||
QKeySequence key;
|
||||
int keyInt;
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ StdTable::StdTable(QWidget* parent) : AbstractTableView(parent)
|
|||
mData.clear();
|
||||
mSort.first = -1;
|
||||
|
||||
mGuiState = StdTable::NoState;
|
||||
|
||||
mCopyMenuOnly = false;
|
||||
mCopyMenuDebugOnly = true;
|
||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,11 @@ static Bridge* mBridge;
|
|||
Bridge::Bridge(QObject* parent) : QObject(parent)
|
||||
{
|
||||
mBridgeMutex = new QMutex();
|
||||
winId = 0;
|
||||
scriptView = 0;
|
||||
referenceView = 0;
|
||||
bridgeResult = 0;
|
||||
hasBridgeResult = false;
|
||||
}
|
||||
|
||||
Bridge::~Bridge()
|
||||
|
|
@ -634,8 +639,8 @@ __declspec(dllexport) void* _gui_sendmessage(GUIMSG type, void* param1, void* pa
|
|||
byte_t wBuffer[16];
|
||||
if(!DbgMemRead(parVA, wBuffer, 16))
|
||||
return 0;
|
||||
QBeaEngine* disasm = new QBeaEngine();
|
||||
Instruction_t instr = disasm->DisassembleAt(wBuffer, 16, 0, 0, parVA);
|
||||
QBeaEngine disasm;
|
||||
Instruction_t instr = disasm.DisassembleAt(wBuffer, 16, 0, 0, parVA);
|
||||
BeaTokenizer::TokenizeInstruction(&instr.tokens, &instr.disasm);
|
||||
QList<RichTextPainter::CustomRichText_t> richText;
|
||||
BeaTokenizer::TokenToRichText(&instr.tokens, &richText, 0);
|
||||
|
|
|
|||
|
|
@ -813,8 +813,8 @@ void CPUDisassembly::assembleAt()
|
|||
|
||||
mMemPage->read(reinterpret_cast<byte_t*>(wBuffer.data()), wRVA, wMaxByteCountToRead);
|
||||
|
||||
QBeaEngine* disasm = new QBeaEngine();
|
||||
Instruction_t instr = disasm->DisassembleAt(reinterpret_cast<byte_t*>(wBuffer.data()), wMaxByteCountToRead, 0, 0, wVA);
|
||||
QBeaEngine disasm;
|
||||
Instruction_t instr = disasm.DisassembleAt(reinterpret_cast<byte_t*>(wBuffer.data()), wMaxByteCountToRead, 0, 0, wVA);
|
||||
|
||||
LineEditDialog mLineEdit(this);
|
||||
mLineEdit.setText(instr.instStr);
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ CPUInfoBox::CPUInfoBox(StdTable* parent) : StdTable(parent)
|
|||
setMinimumHeight(height);
|
||||
connect(Bridge::getBridge(), SIGNAL(dbgStateChanged(DBGSTATE)), this, SLOT(dbgStateChanged(DBGSTATE)));
|
||||
connect(this, SIGNAL(contextMenuSignal(QPoint)), this, SLOT(contextMenuSlot(QPoint)));
|
||||
curAddr = 0;
|
||||
}
|
||||
|
||||
int CPUInfoBox::getHeight()
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ CPUSideBar::CPUSideBar(CPUDisassembly* Ptr, QWidget* parent) : QAbstractScrollAr
|
|||
InstrBuffer = CodePtr->instructionsBuffer();
|
||||
|
||||
backgroundColor = ConfigColor("SideBarBackgroundColor");
|
||||
|
||||
memset(®Dump, 0, sizeof(REGDUMP));
|
||||
}
|
||||
|
||||
QSize CPUSideBar::sizeHint() const
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ CommandHelpView::CommandHelpView(QWidget* parent) : QWidget(parent), ui(new Ui::
|
|||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
mCurrentMode = 0;
|
||||
|
||||
// Set main layout
|
||||
mMainLayout = new QVBoxLayout;
|
||||
mMainLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@ signals:
|
|||
private:
|
||||
Ui::CommandHelpView* ui;
|
||||
QVBoxLayout* mMainLayout;
|
||||
QVBoxLayout* mSymbolLayout;
|
||||
QWidget* mSymbolPlaceHolder;
|
||||
SearchListView* mSearchListView;
|
||||
StdTable* mModuleList;
|
||||
int mCurrentMode;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ ExceptionRangeDialog::ExceptionRangeDialog(QWidget* parent) :
|
|||
ui->editStart->setCursorPosition(0);
|
||||
ui->editEnd->setCursorPosition(0);
|
||||
ui->btnOk->setEnabled(false);
|
||||
rangeStart = 0;
|
||||
rangeEnd = 0;
|
||||
}
|
||||
|
||||
ExceptionRangeDialog::~ExceptionRangeDialog()
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ LineEditDialog::LineEditDialog(QWidget* parent) : QDialog(parent), ui(new Ui::Li
|
|||
setFixedSize(this->size()); //fixed size
|
||||
setModal(true); //modal window
|
||||
ui->checkBox->hide();
|
||||
bChecked = false;
|
||||
}
|
||||
|
||||
LineEditDialog::~LineEditDialog()
|
||||
|
|
|
|||
|
|
@ -546,7 +546,7 @@ void MainWindow::restartDebugging()
|
|||
char filename[MAX_SETTING_SIZE] = "";
|
||||
if(!mMRUList.size())
|
||||
return;
|
||||
strcpy(filename, mMRUList.at(0).toUtf8().constData());
|
||||
strcpy_s(filename, mMRUList.at(0).toUtf8().constData());
|
||||
if(DbgIsDebugging())
|
||||
{
|
||||
DbgCmdExec("stop"); //close current file (when present)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ PageMemoryRights::PageMemoryRights(QWidget* parent) : QDialog(parent), ui(new Ui
|
|||
//set window flags
|
||||
setModal(true);
|
||||
setWindowFlags(Qt::Dialog | Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::MSWindowsFixedSizeDialogHint);
|
||||
addr = 0;
|
||||
size = 0;
|
||||
}
|
||||
|
||||
PageMemoryRights::~PageMemoryRights()
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ SettingsDialog::SettingsDialog(QWidget* parent) :
|
|||
setFixedSize(this->size()); //fixed size
|
||||
LoadSettings(); //load settings from file
|
||||
connect(Bridge::getBridge(), SIGNAL(setLastException(uint)), this, SLOT(setLastException(uint)));
|
||||
lastException = 0;
|
||||
}
|
||||
|
||||
SettingsDialog::~SettingsDialog()
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ ShortcutsDialog::ShortcutsDialog(QWidget* parent) : QDialog(parent), ui(new Ui::
|
|||
QStringList tblHeader;
|
||||
tblHeader << "Instruction" << "Shortcut";
|
||||
|
||||
currentRow = 0;
|
||||
|
||||
ui->tblShortcuts->setColumnCount(2);
|
||||
ui->tblShortcuts->verticalHeader()->setVisible(false);
|
||||
ui->tblShortcuts->setHorizontalHeaderLabels(tblHeader);
|
||||
|
|
|
|||
|
|
@ -15,12 +15,10 @@ class ShortcutsDialog : public QDialog
|
|||
Q_OBJECT
|
||||
Configuration::Shortcut currentShortcut;
|
||||
int currentRow;
|
||||
bool editLock;
|
||||
|
||||
public:
|
||||
explicit ShortcutsDialog(QWidget* parent = 0);
|
||||
~ShortcutsDialog();
|
||||
signals:
|
||||
|
||||
|
||||
protected slots:
|
||||
void syncTextfield();
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ void MHTabWidget::setCurrentIndex(int index)
|
|||
|
||||
void MHTabWidget::setCurrentWidget(QWidget* widget)
|
||||
{
|
||||
widget = 0;
|
||||
Q_UNUSED(widget);
|
||||
// To be implemented.
|
||||
}
|
||||
|
||||
|
|
@ -124,7 +124,7 @@ void MHTabWidget::DetachTab(int index, QPoint & dropPoint)
|
|||
void MHTabWidget::AttachTab(QWidget* parent)
|
||||
{
|
||||
// Retrieve widget
|
||||
MHDetachedWindow* detachedWidget = dynamic_cast<MHDetachedWindow*>(parent);
|
||||
MHDetachedWindow* detachedWidget = reinterpret_cast<MHDetachedWindow*>(parent);
|
||||
QWidget* tearOffWidget = detachedWidget->centralWidget();
|
||||
|
||||
// Reattach the tab
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ CharCommand::CharCommand(XByteArray* xData, Cmd cmd, int charPos, char newChar,
|
|||
_charPos = charPos;
|
||||
_newChar = newChar;
|
||||
_cmd = cmd;
|
||||
_oldChar = 0;
|
||||
}
|
||||
|
||||
bool CharCommand::mergeWith(const QUndoCommand* command)
|
||||
|
|
|
|||
|
|
@ -58,8 +58,6 @@ signals:
|
|||
|
||||
private:
|
||||
QHexEditPrivate* qHexEdit_p;
|
||||
QHBoxLayout* layout;
|
||||
QScrollArea* scrollArea;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ void Breakpoints::setBP(BPXTYPE type, uint_t va)
|
|||
*
|
||||
* @return Nothing.
|
||||
*/
|
||||
void Breakpoints::enableBP(BRIDGEBP bp)
|
||||
void Breakpoints::enableBP(BRIDGEBP & bp)
|
||||
{
|
||||
QString wCmd = "";
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ void Breakpoints::enableBP(BPXTYPE type, uint_t va)
|
|||
*
|
||||
* @return Nothing.
|
||||
*/
|
||||
void Breakpoints::disableBP(BRIDGEBP bp)
|
||||
void Breakpoints::disableBP(BRIDGEBP & bp)
|
||||
{
|
||||
QString wCmd = "";
|
||||
|
||||
|
|
@ -170,7 +170,7 @@ void Breakpoints::disableBP(BPXTYPE type, uint_t va)
|
|||
*
|
||||
* @return Nothing.
|
||||
*/
|
||||
void Breakpoints::removeBP(BRIDGEBP bp)
|
||||
void Breakpoints::removeBP(BRIDGEBP & bp)
|
||||
{
|
||||
QString wCmd = "";
|
||||
|
||||
|
|
@ -244,7 +244,7 @@ void Breakpoints::removeBP(BPXTYPE type, uint_t va)
|
|||
*
|
||||
* @return Nothing.
|
||||
*/
|
||||
void Breakpoints::toggleBPByDisabling(BRIDGEBP bp)
|
||||
void Breakpoints::toggleBPByDisabling(BRIDGEBP & bp)
|
||||
{
|
||||
if(bp.enabled == true)
|
||||
disableBP(bp);
|
||||
|
|
|
|||
|
|
@ -17,13 +17,13 @@ class Breakpoints : public QObject
|
|||
public:
|
||||
explicit Breakpoints(QObject* parent = 0);
|
||||
static void setBP(BPXTYPE type, uint_t va);
|
||||
static void enableBP(BRIDGEBP bp);
|
||||
static void enableBP(BRIDGEBP & bp);
|
||||
static void enableBP(BPXTYPE type, uint_t va);
|
||||
static void disableBP(BRIDGEBP bp);
|
||||
static void disableBP(BRIDGEBP & bp);
|
||||
static void disableBP(BPXTYPE type, uint_t va);
|
||||
static void removeBP(BRIDGEBP bp);
|
||||
static void removeBP(BRIDGEBP & bp);
|
||||
static void removeBP(BPXTYPE type, uint_t va);
|
||||
static void toggleBPByDisabling(BRIDGEBP bp);
|
||||
static void toggleBPByDisabling(BRIDGEBP & bp);
|
||||
static void toggleBPByDisabling(BPXTYPE type, uint_t va);
|
||||
static void toggleBPByRemoving(BPXTYPE type, uint_t va);
|
||||
static BPXSTATE BPState(BPXTYPE type, uint_t va);
|
||||
|
|
|
|||
Loading…
Reference in New Issue