Skip to content

Commit

Permalink
Merge d7f1051 into 04c5050
Browse files Browse the repository at this point in the history
  • Loading branch information
foralost committed Dec 17, 2023
2 parents 04c5050 + d7f1051 commit 203a6a2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/gui/Src/Gui/MemoryMapView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,10 @@ void MemoryMapView::refreshMapSlot()
MEMMAP memoryMap = {};
DbgMemMap(&memoryMap);

setRowCount(memoryMap.count);
duint currSelectedAddressRow = (duint)getCellUserdata(getInitialSelection(), ColAddress);
bool oldAddressFound = false;

setRowCount(memoryMap.count);
auto strUser = tr("User");
auto strSystem = tr("System");

Expand All @@ -444,6 +446,11 @@ void MemoryMapView::refreshMapSlot()
setCellContent(i, ColAddress, ToPtrString((duint)mbi.BaseAddress));
setCellUserdata(i, ColAddress, (duint)mbi.BaseAddress);

if((duint)mbi.BaseAddress == currSelectedAddressRow)
{
oldAddressFound = true;
currSelectedAddressRow = i;
}
// Size
setCellContent(i, ColSize, ToPtrString((duint)mbi.RegionSize));
setCellUserdata(i, ColSize, (duint)mbi.RegionSize);
Expand Down Expand Up @@ -527,6 +534,13 @@ void MemoryMapView::refreshMapSlot()
if(memoryMap.page != 0)
BridgeFree(memoryMap.page);
reloadData(); //refresh memory map

if(oldAddressFound && currSelectedAddressRow != prevSelectedRow)
{
setSingleSelection(currSelectedAddressRow);
prevSelectedRow = currSelectedAddressRow;
}

}

void MemoryMapView::stateChangedSlot(DBGSTATE state)
Expand Down
1 change: 1 addition & 0 deletions src/gui/Src/Gui/MemoryMapView.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,5 @@ public slots:
QMenu* mPluginMenu;

duint mCipBase;
int prevSelectedRow;
};

0 comments on commit 203a6a2

Please sign in to comment.