Debugger: Extend MemoryView listener interface.

MemoryView::Listener:
- Add extra hooks for notifying listener of internal mode changes.
  Implement accordingly in InspectorWindow.
This commit is contained in:
Rene Gollent 2015-05-22 18:01:07 -04:00
parent 68e78ff841
commit 76ada671ba
3 changed files with 49 additions and 0 deletions

View File

@ -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)

View File

@ -53,6 +53,9 @@ public:
// 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,

View File

@ -132,6 +132,10 @@ public:
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;
};