1
0
Fork 0

DBG: fixed another possible memory leak inside _dbg_getbplist when no breakpoints were set

GUI: fixed hardware breakpoint view (thanks to White for the report!)
GUI: fixed Goto dialog (thanks to White for the report!)
This commit is contained in:
mr.exodia 2014-02-20 11:59:08 +01:00
parent 695e8eba12
commit d8b506cfc0
6 changed files with 40 additions and 10 deletions

Binary file not shown.

Binary file not shown.

View File

@ -456,6 +456,11 @@ extern "C" DLL_EXPORT int _dbg_getbplist(BPXTYPE type, BPMAP* bpmap)
bridgeList.push_back(curBp);
retcount++;
}
if(!retcount)
{
bpmap->count=retcount;
return retcount;
}
bpmap->count=retcount;
bpmap->bp=(BRIDGEBP*)BridgeAlloc(sizeof(BRIDGEBP)*retcount);
for(int i=0; i<retcount; i++)

View File

@ -68,7 +68,7 @@ void BreakpointsView::reloadData()
for(wI = 0; wI < wBPList.count; wI++)
{
QString addr_text=QString("%1").arg(wBPList.bp[wI].addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
mSoftBPTable->setCellContent(wI, 0, addr_text);
mHardBPTable->setCellContent(wI, 0, addr_text);
mHardBPTable->setCellContent(wI, 1, QString(wBPList.bp[wI].name));
QString label_text;
@ -77,7 +77,7 @@ void BreakpointsView::reloadData()
label_text="<"+QString(wBPList.bp[wI].mod)+"."+QString(label)+">";
else
label_text=QString(wBPList.bp[wI].mod);
mSoftBPTable->setCellContent(wI, 2, label_text);
mHardBPTable->setCellContent(wI, 2, label_text);
if(wBPList.bp[wI].active == false)
mHardBPTable->setCellContent(wI, 3, "Inactive");
@ -88,7 +88,7 @@ void BreakpointsView::reloadData()
char comment[MAX_COMMENT_SIZE]="";
if(DbgGetCommentAt(wBPList.bp[wI].addr, comment))
mSoftBPTable->setCellContent(wI, 4, comment);
mHardBPTable->setCellContent(wI, 4, comment);
}
mHardBPTable->reloadData();
if(wBPList.count)
@ -132,7 +132,7 @@ void BreakpointsView::reloadData()
for(wI = 0; wI < wBPList.count; wI++)
{
QString addr_text=QString("%1").arg(wBPList.bp[wI].addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
mSoftBPTable->setCellContent(wI, 0, addr_text);
mMemBPTable->setCellContent(wI, 0, addr_text);
mMemBPTable->setCellContent(wI, 1, QString(wBPList.bp[wI].name));
QString label_text;
@ -141,7 +141,7 @@ void BreakpointsView::reloadData()
label_text="<"+QString(wBPList.bp[wI].mod)+"."+QString(label)+">";
else
label_text=QString(wBPList.bp[wI].mod);
mSoftBPTable->setCellContent(wI, 2, label_text);
mMemBPTable->setCellContent(wI, 2, label_text);
if(wBPList.bp[wI].active == false)
mMemBPTable->setCellContent(wI, 3, "Inactive");
@ -152,7 +152,7 @@ void BreakpointsView::reloadData()
char comment[MAX_COMMENT_SIZE]="";
if(DbgGetCommentAt(wBPList.bp[wI].addr, comment))
mSoftBPTable->setCellContent(wI, 4, comment);
mMemBPTable->setCellContent(wI, 4, comment);
}
mMemBPTable->reloadData();
if(wBPList.count)

View File

@ -40,8 +40,33 @@ void GotoDialog::on_editExpression_textChanged(const QString &arg1)
}
else
{
ui->labelError->setText("<font color='#00FF00'><b>Correct expression!</b></color>");
ui->buttonOk->setEnabled(true);
expressionText=arg1;
duint addr=DbgValFromString(arg1.toUtf8().constData());
if(!DbgMemIsValidReadPtr(addr))
{
ui->labelError->setText("<font color='red'><b>Invalid memory address...</b></color>");
ui->buttonOk->setEnabled(false);
expressionText.clear();
}
else
{
QString addrText;
char module[MAX_MODULE_SIZE]="";
char label[MAX_LABEL_SIZE]="";
if(DbgGetLabelAt(addr, SEG_DEFAULT, label)) //has label
{
if(DbgGetModuleAt(addr, module))
addrText=QString(module)+"."+QString(label);
else
addrText=QString(label);
}
else if(DbgGetModuleAt(addr, module))
addrText=QString(module)+"."+QString("%1").arg(addr, sizeof(int_t)*2, 16, QChar('0')).toUpper();
else
addrText=QString("%1").arg(addr, sizeof(int_t)*2, 16, QChar('0')).toUpper();
ui->labelError->setText(QString("<font color='#00FF00'><b>Correct expression! -> </b></color>" + addrText));
ui->buttonOk->setEnabled(true);
expressionText=arg1;
}
}
}

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>420</width>
<width>539</width>
<height>92</height>
</rect>
</property>