VariableList

Detailed Description

Classes

class  VariableListItem
 An item part of VariableListModel. More...
 
class  VariableListModel
 The backing model for the variable list widget, holds VariableListItem. More...
 
class  VariableListItemDelegate
 
class  VariableList
 The main variable list dock widget. More...
 
class  VariableListSidebarWidgetType
 The main variable list dock widget. More...
 

Enumerations

enum class  VariableListItemType { VariableListItemType::LocalVariable , VariableListItemType::DataVariable }
 A variable list item can represent either a function-local variable, or a data variable referenced by the current function. More...
 

Class Documentation

◆ VariableListItem

class VariableListItem

An item part of VariableListModel.

Public Member Functions

 VariableListItem (FunctionRef func, BinaryNinja::Variable var, BinaryNinja::PossibleValueSet pvs, bool hasUidf, std::string name)
 Create a new VariableListItem of the LocalVariable type. More...
 
 VariableListItem (FunctionRef func, BinaryNinja::DataVariable dataVar, uint64_t refPoint, std::string name)
 Create a new VariableListItem of the DataVariable type. More...
 
VariableListItemType type () const
 Get the type of this list item. More...
 
std::string name () const
 Get the represented variable's display name. More...
 
std::string constantValue () const
 Get the data variable's value; use with data variable items only. More...
 
BinaryNinja::PossibleValueSet possibleValueSet () const
 Get the variable possible value set; use with local variable items only. More...
 
bool hasUidf () const
 Is the PVS user-provided? Use with local variable items only. More...
 
std::vector< BinaryNinja::InstructionTextTokentokensBeforeName () const
 
std::vector< BinaryNinja::InstructionTextTokentokensAfterName () const
 
std::vector< BinaryNinja::InstructionTextTokendisplayTokens () const
 Shorthand to get concatenated type, name, and value tokens. More...
 
BinaryNinja::Variable variable () const
 Get the represented variable; use with variable items only. More...
 
BinaryNinja::DataVariable dataVariable () const
 Get the represented data variable; use with data variable items only. More...
 
uint64_t refPoint () const
 Get the first use of this variable; use with data variables items only. More...
 
bool isUserDefined () const
 Is any part of this item user-defined? More...
 

Constructor & Destructor Documentation

◆ VariableListItem() [1/2]

VariableListItem::VariableListItem ( FunctionRef  func,
BinaryNinja::Variable  var,
BinaryNinja::PossibleValueSet  pvs,
bool  hasUidf,
std::string  name 
)

Create a new VariableListItem of the LocalVariable type.

◆ VariableListItem() [2/2]

VariableListItem::VariableListItem ( FunctionRef  func,
BinaryNinja::DataVariable  dataVar,
uint64_t  refPoint,
std::string  name 
)

Create a new VariableListItem of the DataVariable type.

Member Function Documentation

◆ type()

VariableListItemType VariableListItem::type ( ) const

Get the type of this list item.

◆ name()

std::string VariableListItem::name ( ) const

Get the represented variable's display name.

◆ constantValue()

std::string VariableListItem::constantValue ( ) const

Get the data variable's value; use with data variable items only.

◆ possibleValueSet()

BinaryNinja::PossibleValueSet VariableListItem::possibleValueSet ( ) const

Get the variable possible value set; use with local variable items only.

◆ hasUidf()

bool VariableListItem::hasUidf ( ) const

Is the PVS user-provided? Use with local variable items only.

◆ tokensBeforeName()

std::vector< BinaryNinja::InstructionTextToken > VariableListItem::tokensBeforeName ( ) const

◆ tokensAfterName()

std::vector< BinaryNinja::InstructionTextToken > VariableListItem::tokensAfterName ( ) const

◆ displayTokens()

std::vector< BinaryNinja::InstructionTextToken > VariableListItem::displayTokens ( ) const

Shorthand to get concatenated type, name, and value tokens.

◆ variable()

BinaryNinja::Variable VariableListItem::variable ( ) const

Get the represented variable; use with variable items only.

◆ dataVariable()

BinaryNinja::DataVariable VariableListItem::dataVariable ( ) const

Get the represented data variable; use with data variable items only.

◆ refPoint()

uint64_t VariableListItem::refPoint ( ) const

Get the first use of this variable; use with data variables items only.

◆ isUserDefined()

bool VariableListItem::isUserDefined ( ) const

Is any part of this item user-defined?

◆ VariableListModel

class VariableListModel

The backing model for the variable list widget, holds VariableListItem.

Public Member Functions

 VariableListModel (QWidget *parent, ViewFrame *view, BinaryViewRef data)
 
void clear ()
 Clear the list's content. More...
 
FunctionRef function () const
 Get the current function. More...
 
BNFunctionGraphType functionType () const
 Get the current function type. More...
 
bool functionExceedsComplexity () const
 Whether or not the function exceeds the set complexity threshold. More...
 
void setFunction (FunctionRef func, BNFunctionGraphType il, const HighlightTokenState &hts)
 Set the focused function and update the content of the list. More...
 
void setSelectionModel (QItemSelectionModel *model)
 Set the selection model, should correspond to the parent widget's. More...
 
virtual QVariant data (const QModelIndex &i, int role) const override
 
virtual QModelIndex index (int row, int col, const QModelIndex &parent=QModelIndex()) const override
 
virtual int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
virtual int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
virtual QVariant headerData (int column, Qt::Orientation orientation, int role) const override
 
void linkActivatedEvent (const QString &link)
 

Constructor & Destructor Documentation

◆ VariableListModel()

VariableListModel::VariableListModel ( QWidget *  parent,
ViewFrame view,
BinaryViewRef  data 
)

Member Function Documentation

◆ clear()

void VariableListModel::clear ( )

Clear the list's content.

◆ function()

FunctionRef VariableListModel::function ( ) const

Get the current function.

◆ functionType()

BNFunctionGraphType VariableListModel::functionType ( ) const

Get the current function type.

◆ functionExceedsComplexity()

bool VariableListModel::functionExceedsComplexity ( ) const
inline

Whether or not the function exceeds the set complexity threshold.

◆ setFunction()

void VariableListModel::setFunction ( FunctionRef  func,
BNFunctionGraphType  il,
const HighlightTokenState hts 
)

Set the focused function and update the content of the list.

◆ setSelectionModel()

void VariableListModel::setSelectionModel ( QItemSelectionModel *  model)

Set the selection model, should correspond to the parent widget's.

◆ data()

virtual QVariant VariableListModel::data ( const QModelIndex &  i,
int  role 
) const
overridevirtual

◆ index()

virtual QModelIndex VariableListModel::index ( int  row,
int  col,
const QModelIndex &  parent = QModelIndex() 
) const
overridevirtual

◆ columnCount()

virtual int VariableListModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
overridevirtual

◆ rowCount()

virtual int VariableListModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
overridevirtual

◆ flags()

Qt::ItemFlags VariableListModel::flags ( const QModelIndex &  index) const
override

◆ headerData()

virtual QVariant VariableListModel::headerData ( int  column,
Qt::Orientation  orientation,
int  role 
) const
overridevirtual

◆ linkActivatedEvent()

void VariableListModel::linkActivatedEvent ( const QString &  link)

◆ VariableListItemDelegate

class VariableListItemDelegate

Public Member Functions

 VariableListItemDelegate ()
 
void paint (QPainter *painter, const QStyleOptionViewItem &opt, const QModelIndex &index) const
 
QSize sizeHint (const QStyleOptionViewItem &opt, const QModelIndex &index) const
 

Constructor & Destructor Documentation

◆ VariableListItemDelegate()

VariableListItemDelegate::VariableListItemDelegate ( )

Member Function Documentation

◆ paint()

void VariableListItemDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  opt,
const QModelIndex &  index 
) const

◆ sizeHint()

QSize VariableListItemDelegate::sizeHint ( const QStyleOptionViewItem &  opt,
const QModelIndex &  index 
) const

◆ VariableList

class VariableList

The main variable list dock widget.

Public Member Functions

 VariableList (ViewFrame *view, BinaryViewRef data)
 
QWidget * headerWidget () override
 
void focus () override
 
void refresh ()
 
VariableListItemselectedItem () const
 Get the VariableListItem corresponding to the current selection. More...
 
void changeSelectedVariableName ()
 Show the rename dialog for the selected variable. More...
 
void changeSelectedVariableType ()
 Show the new type dialog for the selected variable. More...
 
void mergeSelectedVariable ()
 Show the "merge variables" dialog for the selected variable. More...
 
void clearSelectedVariableName ()
 Clear the selected variable's name. More...
 
void clearSelectedVariableType ()
 Clear the selected variable's type. More...
 
void clearSelectedVariableNameAndType ()
 Undefine the selected variable's user symbol. More...
 
void showSelectedVariableFirstUsage ()
 Navigate to the first usage of the selected variable. More...
 
void showSelectedDataVariableDefinition ()
 Navigate to the definition of the selected data variable. More...
 
void setSelectedVariableDeadStoreElimination (BNDeadStoreElimination dse)
 Set the selected variable's DSE policy. More...
 
void setSelectedVariableValue ()
 Prompt the user to set the selected variable's value. More...
 
void resetSelectedVariableValue ()
 Remove UIDF for the selected variable. More...
 
virtual void setFilter (const std::string &filter) override
 
virtual void scrollToFirstItem () override
 
virtual void scrollToCurrentItem () override
 
virtual void selectFirstItem () override
 
virtual void activateFirstItem () override
 
- Public Member Functions inherited from SidebarWidget
 SidebarWidget (const QString &title)
 
 ~SidebarWidget ()
 
const QString & title () const
 
void enableRefreshTimer (int interval)
 
void setRefreshQuiesce (bool enable)
 
bool isQuiesced () const
 
virtual void notifyRefresh ()
 
virtual void notifyQuiesce (bool)
 
virtual void notifyFontChanged ()
 
virtual void notifyOffsetChanged (uint64_t)
 
virtual void notifyThemeChanged ()
 
virtual void notifyViewChanged (ViewFrame *)
 
virtual void notifyViewLocationChanged (View *, const ViewLocation &)
 
virtual void focus ()
 
virtual void closing ()
 
virtual void setPrimaryOrientation (Qt::Orientation)
 
virtual QWidget * headerWidget ()
 
- Public Member Functions inherited from FilterTarget
virtual ~FilterTarget ()
 
virtual void setFilter (const std::string &filter)=0
 
virtual void scrollToFirstItem ()=0
 
virtual void scrollToCurrentItem ()=0
 
virtual void selectFirstItem ()=0
 
virtual void activateFirstItem ()=0
 
virtual void closeFilter ()
 

Additional Inherited Members

- Protected Attributes inherited from SidebarWidget
QString m_title
 
UIActionHandler m_actionHandler
 
ContextMenuManagerm_contextMenuManager = nullptr
 
Menum_menu = nullptr
 
bool m_quiesceState = true
 
QTimer * m_updateTimer = nullptr
 

Constructor & Destructor Documentation

◆ VariableList()

VariableList::VariableList ( ViewFrame view,
BinaryViewRef  data 
)

Member Function Documentation

◆ headerWidget()

QWidget * VariableList::headerWidget ( )
inlineoverridevirtual

Reimplemented from SidebarWidget.

◆ focus()

void VariableList::focus ( )
inlineoverridevirtual

Reimplemented from SidebarWidget.

◆ refresh()

void VariableList::refresh ( )

◆ selectedItem()

VariableListItem * VariableList::selectedItem ( ) const

Get the VariableListItem corresponding to the current selection.

◆ changeSelectedVariableName()

void VariableList::changeSelectedVariableName ( )

Show the rename dialog for the selected variable.

◆ changeSelectedVariableType()

void VariableList::changeSelectedVariableType ( )

Show the new type dialog for the selected variable.

◆ mergeSelectedVariable()

void VariableList::mergeSelectedVariable ( )

Show the "merge variables" dialog for the selected variable.

◆ clearSelectedVariableName()

void VariableList::clearSelectedVariableName ( )

Clear the selected variable's name.

◆ clearSelectedVariableType()

void VariableList::clearSelectedVariableType ( )

Clear the selected variable's type.

◆ clearSelectedVariableNameAndType()

void VariableList::clearSelectedVariableNameAndType ( )

Undefine the selected variable's user symbol.

◆ showSelectedVariableFirstUsage()

void VariableList::showSelectedVariableFirstUsage ( )

Navigate to the first usage of the selected variable.

◆ showSelectedDataVariableDefinition()

void VariableList::showSelectedDataVariableDefinition ( )

Navigate to the definition of the selected data variable.

◆ setSelectedVariableDeadStoreElimination()

void VariableList::setSelectedVariableDeadStoreElimination ( BNDeadStoreElimination  dse)

Set the selected variable's DSE policy.

◆ setSelectedVariableValue()

void VariableList::setSelectedVariableValue ( )

Prompt the user to set the selected variable's value.

◆ resetSelectedVariableValue()

void VariableList::resetSelectedVariableValue ( )

Remove UIDF for the selected variable.

◆ setFilter()

virtual void VariableList::setFilter ( const std::string &  filter)
overridevirtual

Implements FilterTarget.

◆ scrollToFirstItem()

virtual void VariableList::scrollToFirstItem ( )
overridevirtual

Implements FilterTarget.

◆ scrollToCurrentItem()

virtual void VariableList::scrollToCurrentItem ( )
overridevirtual

Implements FilterTarget.

◆ selectFirstItem()

virtual void VariableList::selectFirstItem ( )
overridevirtual

Implements FilterTarget.

◆ activateFirstItem()

virtual void VariableList::activateFirstItem ( )
overridevirtual

Implements FilterTarget.

◆ VariableListSidebarWidgetType

class VariableListSidebarWidgetType

The main variable list dock widget.

Public Member Functions

 VariableListSidebarWidgetType ()
 
virtual SidebarWidgetcreateWidget (ViewFrame *frame, BinaryViewRef data) override
 
virtual SidebarWidgetLocation defaultLocation () const override
 
- Public Member Functions inherited from SidebarWidgetType
 SidebarWidgetType (const QImage &icon, const QString &name)
 
virtual ~SidebarWidgetType ()
 
const SidebarIconicon () const
 
const QString & name () const
 
virtual bool isInReferenceArea () const
 
virtual bool viewSensitive () const
 
virtual SidebarWidgetLocation defaultLocation () const
 
virtual SidebarContextSensitivity contextSensitivity () const
 
virtual bool alwaysShowTabs () const
 
virtual bool hideIfNoContent () const
 
virtual SidebarWidgetcreateWidget (ViewFrame *, BinaryViewRef)
 
virtual SidebarWidgetcreateInvalidContextWidget ()
 
virtual QWidget * headerWidget (SplitPaneWidget *, ViewFrame *, BinaryViewRef)
 
virtual bool focusHeaderWidget () const
 
virtual QString noWidgetMessage () const
 
virtual DockableTabStyletabStyle () const
 
virtual bool canUseAsPane (SplitPaneWidget *, BinaryViewRef) const
 
virtual PanecreatePane (SplitPaneWidget *, BinaryViewRef)
 
void updateTheme ()
 

Constructor & Destructor Documentation

◆ VariableListSidebarWidgetType()

VariableListSidebarWidgetType::VariableListSidebarWidgetType ( )

Member Function Documentation

◆ createWidget()

virtual SidebarWidget * VariableListSidebarWidgetType::createWidget ( ViewFrame frame,
BinaryViewRef  data 
)
overridevirtual

Reimplemented from SidebarWidgetType.

◆ defaultLocation()

virtual SidebarWidgetLocation VariableListSidebarWidgetType::defaultLocation ( ) const
inlineoverridevirtual

Reimplemented from SidebarWidgetType.

Enumeration Type Documentation

◆ VariableListItemType

enum class VariableListItemType
strong

A variable list item can represent either a function-local variable, or a data variable referenced by the current function.

Enumerator
LocalVariable 
DataVariable