1
0
Fork 0

fix 2 issues (#788)

* fix now-broken trace record storage

* fix self-jumping appearance
This commit is contained in:
Torusrxxx 2016-06-23 01:16:11 +00:00 committed by Duncan Ogilvie
parent d8e6478e59
commit 16065a273e
2 changed files with 12 additions and 5 deletions

View File

@ -299,7 +299,7 @@ void TraceRecordManager::saveToDb(JSON root)
json_array_append_new(jsonTraceRecords, jsonObj); json_array_append_new(jsonTraceRecords, jsonObj);
} }
if(json_array_size(jsonTraceRecords)) if(json_array_size(jsonTraceRecords))
json_object_set_new(root, "tracerecord", jsonTraceRecords); json_object_set(root, "tracerecord", jsonTraceRecords);
// Notify garbage collector // Notify garbage collector
json_decref(jsonTraceRecords); json_decref(jsonTraceRecords);

View File

@ -226,8 +226,8 @@ void CPUSideBar::paintEvent(QPaintEvent* event)
duint destVA = DbgGetBranchDestination(baseAddr + instr.rva); duint destVA = DbgGetBranchDestination(baseAddr + instr.rva);
// Do not try to draw EBFE (Jump to the same line) // Do not try to draw EBFE (Jump to the same line)
if(destVA == instrVA) //if(destVA == instrVA)
continue; // continue;
// Do not draw jumps that leave the memory range // Do not draw jumps that leave the memory range
if(destVA >= mDisas->getBase() + mDisas->getSize() || destVA < mDisas->getBase()) if(destVA >= mDisas->getBase() + mDisas->getSize() || destVA < mDisas->getBase())
@ -457,8 +457,15 @@ void CPUSideBar::drawJump(QPainter* painter, int startLine, int endLine, int jum
const int JumpPadding = 11; const int JumpPadding = 11;
int x = viewportWidth - jumpoffset * JumpPadding - 15 - fontHeight; int x = viewportWidth - jumpoffset * JumpPadding - 15 - fontHeight;
int x_right = viewportWidth - 12; int x_right = viewportWidth - 12;
const int y_start = fontHeight * (1 + startLine) - 0.5 * fontHeight - pixel_y_offs; int y_start = fontHeight * (1 + startLine) - 0.5 * fontHeight - pixel_y_offs;
const int y_end = fontHeight * (1 + endLine) - 0.5 * fontHeight; int y_end = fontHeight * (1 + endLine) - 0.5 * fontHeight;
// special handling of self-jumping
if(startLine == endLine)
{
y_start -= fontHeight / 4;
y_end += fontHeight / 4;
}
// Horizontal (<----) // Horizontal (<----)
if(!isFoldingGraphicsPresent(startLine) != 0) if(!isFoldingGraphicsPresent(startLine) != 0)