Skip to content

Commit

Permalink
dissasm integrated option to delete collapsible zones #215
Browse files Browse the repository at this point in the history
  • Loading branch information
rzaharia committed Mar 2, 2024
1 parent 0b59483 commit 137821b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions GViewCore/src/View/DissasmViewer/DissasmViewer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ namespace View
bool changedLevel;
InternalTypeNewLevelChangeData newLevelChangeData;

void ResetZoneCaching();
bool AddCollapsibleZone(uint32 zoneLineStart, uint32 zoneLineEnd);
bool CanAddNewZone(uint32 zoneLineStart, uint32 zoneLineEnd) const
{
Expand Down
15 changes: 14 additions & 1 deletion GViewCore/src/View/DissasmViewer/DissasmX86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1563,6 +1563,10 @@ void Instance::CommandExecuteCollapsibleZoneOperation(CollapsibleZoneOperation o
if (!zone->CollapseOrExtendZone(zoneLineStart, DissasmCodeZone::CollapseExpandType::Collapse, difference))
operationName = "Collapse";
break;
case CollapsibleZoneOperation::Remove:
if (!zone->RemoveCollapsibleZone(zoneLineStart))
operationName = "Collapse";
break;
default:
Dialogs::MessageBox::ShowNotification("Warning", "Unimplemented!");
break;
Expand All @@ -1573,7 +1577,7 @@ void Instance::CommandExecuteCollapsibleZoneOperation(CollapsibleZoneOperation o
message.SetFormat("Failed to %s to zone!", operationName);
Dialogs::MessageBox::ShowNotification("Error", message);
} else {
zone->asmPreCacheData.Clear();
zone->ResetZoneCaching();
if (difference) {
AdjustZoneExtendedSize(zone, difference);
}
Expand Down Expand Up @@ -1886,6 +1890,15 @@ bool DissasmCodeZone::RemoveCollapsibleZone(uint32 zoneLine)
return true;
}

void DissasmCodeZone::ResetZoneCaching()
{
asmPreCacheData.Clear();
for (auto& type : types) {
type.get().asmLinesPassed = 0;
type.get().textLinesPassed = 0;
}
}

bool DissasmCodeZone::AddCollapsibleZone(uint32 zoneLineStart, uint32 zoneLineEnd)
{
if (!this->CanAddNewZone(zoneLineStart, zoneLineEnd)) {
Expand Down

0 comments on commit 137821b

Please sign in to comment.