diff options
| author | Glenn Smith <glenn@vector35.com> | 2024-05-07 19:33:54 -0400 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2024-05-07 19:33:54 -0400 |
| commit | 1188642195069045033870938648783893831544 (patch) | |
| tree | 3d227f1b013497fabf6bf7cc619fe46d91717b5e /ui/stackview.h | |
| parent | 5523493721842129489488904017368590948466 (diff) | |
Stack view: Allow switching base register offset
Diffstat (limited to 'ui/stackview.h')
| -rw-r--r-- | ui/stackview.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ui/stackview.h b/ui/stackview.h index 934410f9..6202a8fb 100644 --- a/ui/stackview.h +++ b/ui/stackview.h @@ -80,6 +80,15 @@ class StackViewLine //! Get the stack frame offset for this line. int64_t offset() const; + //! Get the value of the base offset + int64_t baseOffset() const; + + //! Get the name of the base offset + std::string baseName() const; + + //! Set the base offset to a given name and value. Does not affect offset() + void setBase(const std::string& baseName, int64_t baseOffset); + //! Get the number of bytes this line represents on the stack. size_t width() const; @@ -148,6 +157,9 @@ class StackViewLine BinaryNinja::Variable m_var; size_t m_widthOverride; + std::string m_baseName; + int64_t m_baseOffset; + bool m_isReferenced; bool m_isUnused; @@ -257,6 +269,9 @@ class BINARYNINJAUIAPI StackView : public QAbstractScrollArea, public View //! Create a new struct at the cursor, spanning until the next stack variable. void quickCreateStructAtCursor(); + //! Show the dialog to switch which base register is used for offsets + void chooseBaseRegister(); + //! Override the default event handler so we can have nice tooltips. bool event(QEvent* event) override; @@ -278,11 +293,13 @@ class BINARYNINJAUIAPI StackViewSidebarWidget : public SidebarWidget { Q_OBJECT + QWidget* m_header; StackView* m_stackView; public: StackViewSidebarWidget(ViewFrame* view, BinaryViewRef data); + QWidget* headerWidget() override { return m_header; } void refresh(); void focus() override { refresh(); } void notifyFontChanged() override { m_stackView->updateFonts(); } |
