Miasm2
 All Classes Namespaces Files Functions Variables Typedefs Properties Macros
Public Member Functions | Public Attributes | Private Attributes | Static Private Attributes | List of all members
miasm2.analysis.depgraph.DependencyNode Class Reference
+ Inheritance diagram for miasm2.analysis.depgraph.DependencyNode:
+ Collaboration diagram for miasm2.analysis.depgraph.DependencyNode:

Public Member Functions

def __init__
 
def __hash__
 
def __eq__
 
def __cmp__
 
def __str__
 
def __repr__
 
def nostep_repr
 
def label
 
def element
 
def line_nb
 
def step
 
def modifier
 
def modifier
 

Public Attributes

 label
 
 element
 
 line_nb
 
 step
 

Private Attributes

 _label
 
 _element
 
 _line_nb
 
 _modifier
 
 _step
 
 _nostep_repr
 
 _hash
 

Static Private Attributes

list __slots__
 

Detailed Description

Node elements of a DependencyGraph

A dependency node stands for the dependency on the @element at line number
@line_nb in the IRblock named @label, *before* the evaluation of this
line.

Definition at line 20 of file depgraph.py.

Constructor & Destructor Documentation

def miasm2.analysis.depgraph.DependencyNode.__init__ (   self,
  label,
  element,
  line_nb,
  step,
  modifier = False 
)
Create a dependency node with:
@label: asm_label instance
@element: Expr instance
@line_nb: int
@modifier: bool

Definition at line 32 of file depgraph.py.

32 
33  def __init__(self, label, element, line_nb, step, modifier=False):
34  """Create a dependency node with:
35  @label: asm_label instance
36  @element: Expr instance
37  @line_nb: int
38  @modifier: bool
39  """
40  self._label = label
41  self._element = element
42  self._line_nb = line_nb
43  self._modifier = modifier
44  self._step = step
45  self._nostep_repr = (self._label, self._line_nb, self._element)
46  self._hash = hash(
47  (self._label, self._element, self._line_nb, self._step))

Member Function Documentation

def miasm2.analysis.depgraph.DependencyNode.__cmp__ (   self,
  node 
)
Compares @self with @node. The step attribute is not taken into
account in the comparison.

Definition at line 63 of file depgraph.py.

63 
64  def __cmp__(self, node):
65  """Compares @self with @node. The step attribute is not taken into
66  account in the comparison.
67  """
68  if not isinstance(node, self.__class__):
69  raise ValueError("Compare error between %s, %s" % (self.__class__,
70  node.__class__))
71  return cmp((self.label, self.element, self.line_nb),
72  (node.label, node.element, node.line_nb))

+ Here is the call graph for this function:

def miasm2.analysis.depgraph.DependencyNode.__eq__ (   self,
  depnode 
)
Returns True if @self and @depnode are equals.
The attribute 'step' is not considered in the comparison.

Definition at line 52 of file depgraph.py.

52 
53  def __eq__(self, depnode):
54  """Returns True if @self and @depnode are equals.
55  The attribute 'step' is not considered in the comparison.
56  """
57  if not isinstance(depnode, self.__class__):
58  return False
59  return (self.label == depnode.label and
60  self.element == depnode.element and
61  self.line_nb == depnode.line_nb and
62  self.step == depnode.step)

+ Here is the caller graph for this function:

def miasm2.analysis.depgraph.DependencyNode.__hash__ (   self)
Returns a hash of @self to uniquely identify @self

Definition at line 48 of file depgraph.py.

48 
49  def __hash__(self):
50  """Returns a hash of @self to uniquely identify @self"""
51  return self._hash
def miasm2.analysis.depgraph.DependencyNode.__repr__ (   self)
Returns a string representation of DependencyNode

Definition at line 80 of file depgraph.py.

80 
81  def __repr__(self):
82  """Returns a string representation of DependencyNode"""
83  return self.__str__()

+ Here is the call graph for this function:

def miasm2.analysis.depgraph.DependencyNode.__str__ (   self)
Returns a string representation of DependencyNode

Definition at line 73 of file depgraph.py.

73 
74  def __str__(self):
75  """Returns a string representation of DependencyNode"""
76  return "<%s %s %s %s M:%s S:%s>" % (self.__class__.__name__,
77  self.label.name, self.element,
78  self.line_nb, self.modifier,
79  self.step)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def miasm2.analysis.depgraph.DependencyNode.element (   self)

Definition at line 95 of file depgraph.py.

95 
96  def element(self):
97  "Current tracked Expr"
98  return self._element
def miasm2.analysis.depgraph.DependencyNode.label (   self)

Definition at line 90 of file depgraph.py.

90 
91  def label(self):
92  "Name of the current IRBlock"
93  return self._label
def miasm2.analysis.depgraph.DependencyNode.line_nb (   self)

Definition at line 100 of file depgraph.py.

101  def line_nb(self):
102  "Line in the current IRBlock"
103  return self._line_nb
def miasm2.analysis.depgraph.DependencyNode.modifier (   self)
Evaluating the current line involves a modification of tracked
dependencies

Definition at line 110 of file depgraph.py.

111  def modifier(self):
112  """Evaluating the current line involves a modification of tracked
113  dependencies"""
114  return self._modifier

+ Here is the caller graph for this function:

def miasm2.analysis.depgraph.DependencyNode.modifier (   self,
  value 
)
Evaluating the current line involves a modification of tracked
dependencies if @value.
@value: boolean

Definition at line 116 of file depgraph.py.

117  def modifier(self, value):
118  """Evaluating the current line involves a modification of tracked
119  dependencies if @value.
120  @value: boolean"""
121  self._modifier = value
122 

+ Here is the call graph for this function:

def miasm2.analysis.depgraph.DependencyNode.nostep_repr (   self)
Returns a representation of @self ignoring the step attribute

Definition at line 85 of file depgraph.py.

85 
86  def nostep_repr(self):
87  """Returns a representation of @self ignoring the step attribute"""
88  return self._nostep_repr
def miasm2.analysis.depgraph.DependencyNode.step (   self)

Definition at line 105 of file depgraph.py.

106  def step(self):
107  "Step of the current node"
108  return self._step

Member Data Documentation

list miasm2.analysis.depgraph.DependencyNode.__slots__
staticprivate
Initial value:
1 = ["_label", "_element", "_line_nb", "_modifier",
2  "_step", "_nostep_repr", "_hash"]

Definition at line 29 of file depgraph.py.

miasm2.analysis.depgraph.DependencyNode._element
private

Definition at line 40 of file depgraph.py.

miasm2.analysis.depgraph.DependencyNode._hash
private

Definition at line 45 of file depgraph.py.

miasm2.analysis.depgraph.DependencyNode._label
private

Definition at line 39 of file depgraph.py.

miasm2.analysis.depgraph.DependencyNode._line_nb
private

Definition at line 41 of file depgraph.py.

miasm2.analysis.depgraph.DependencyNode._modifier
private

Definition at line 42 of file depgraph.py.

miasm2.analysis.depgraph.DependencyNode._nostep_repr
private

Definition at line 44 of file depgraph.py.

miasm2.analysis.depgraph.DependencyNode._step
private

Definition at line 43 of file depgraph.py.

miasm2.analysis.depgraph.DependencyNode.element

Definition at line 59 of file depgraph.py.

miasm2.analysis.depgraph.DependencyNode.label

Definition at line 58 of file depgraph.py.

miasm2.analysis.depgraph.DependencyNode.line_nb

Definition at line 60 of file depgraph.py.

miasm2.analysis.depgraph.DependencyNode.step

Definition at line 61 of file depgraph.py.


The documentation for this class was generated from the following file: