From 9355626405982962404231299703688263783871 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Wed, 8 May 2024 12:10:47 -0400 Subject: Stack view: allow setting arbitrary base offset by double-click --- ui/stackview.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'ui/stackview.h') diff --git a/ui/stackview.h b/ui/stackview.h index 12a8b87a..d198ff4d 100644 --- a/ui/stackview.h +++ b/ui/stackview.h @@ -4,6 +4,7 @@ #include #include #include +#include #include "dockhandler.h" #include "render.h" @@ -196,6 +197,9 @@ class BINARYNINJAUIAPI StackView : public QAbstractScrollArea, public View HighlightTokenState m_highlight; size_t m_lineIndex; size_t m_tokenIndex; + bool m_needFirstFocus; + + std::optional m_baseOffset; //! Bind and register all stack view actions. void setupActions(); @@ -272,6 +276,15 @@ class BINARYNINJAUIAPI StackView : public QAbstractScrollArea, public View //! Show the dialog to switch which base register is used for offsets void chooseBaseRegister(); + //! Show the dialog to pick a constant base offset + void chooseBaseOffset(); + + //! Set the base offset to a register (or clear on nullopt) + void setBaseRegister(ArchitectureRef arch, std::optional regName); + + //! Set the base offset to a constant (or clear on nullopt) + void setBaseOffset(std::optional offset); + //! Override the default event handler so we can have nice tooltips. bool event(QEvent* event) override; -- cgit v1.3.1