Skip to content

Commit

Permalink
Debugger: Extend MemoryView listener interface.
Browse files Browse the repository at this point in the history
MemoryView::Listener:
- Add extra hooks for notifying listener of internal mode changes.
  Implement accordingly in InspectorWindow.
  • Loading branch information
anevilyak committed May 23, 2015
1 parent 68e78ff commit 76ada67
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
Expand Up @@ -391,6 +391,48 @@ InspectorWindow::TargetAddressChanged(target_addr_t address)
}


void
InspectorWindow::HexModeChanged(int32 newMode)
{
AutoLocker<BLooper> lock(this);
if (lock.IsLocked()) {
BMenu* menu = fHexMode->Menu();
if (newMode < 0 || newMode > menu->CountItems())
return;
BMenuItem* item = menu->ItemAt(newMode);
item->SetMarked(true);
}
}


void
InspectorWindow::EndianModeChanged(int32 newMode)
{
AutoLocker<BLooper> lock(this);
if (lock.IsLocked()) {
BMenu* menu = fEndianMode->Menu();
if (newMode < 0 || newMode > menu->CountItems())
return;
BMenuItem* item = menu->ItemAt(newMode);
item->SetMarked(true);
}
}


void
InspectorWindow::TextModeChanged(int32 newMode)
{
AutoLocker<BLooper> lock(this);
if (lock.IsLocked()) {
BMenu* menu = fTextMode->Menu();
if (newMode < 0 || newMode > menu->CountItems())
return;
BMenuItem* item = menu->ItemAt(newMode);
item->SetMarked(true);
}
}


void
InspectorWindow::ExpressionEvaluated(ExpressionInfo* info, status_t result,
ExpressionResult* value)
Expand Down
Expand Up @@ -53,6 +53,9 @@ class InspectorWindow : public BWindow, private Team::Listener,

// MemoryView::Listener
virtual void TargetAddressChanged(target_addr_t address);
virtual void HexModeChanged(int32 newMode);
virtual void EndianModeChanged(int32 newMode);
virtual void TextModeChanged(int32 newMode);

// ExpressionInfo::Listener
virtual void ExpressionEvaluated(ExpressionInfo* info,
Expand Down
Expand Up @@ -132,6 +132,10 @@ class MemoryView::Listener {

virtual void TargetAddressChanged(target_addr_t address)
= 0;

virtual void HexModeChanged(int32 newMode) = 0;
virtual void TextModeChanged(int32 newMode) = 0;
virtual void EndianModeChanged(int32 newMode) = 0;
};


Expand Down

0 comments on commit 76ada67

Please sign in to comment.