(self, variable, location, size_threshold=32)
return new_defs_added
Add a new definition of variable.

        :param SimVariable variable: The variable being defined.
        :param CodeLocation location: Location of the varaible being defined.
        :param int size_threshold: The maximum bytes to consider for the variable.
        :return: True if the definition was new, False otherwise
        :rtype: bool
Add a new definition of variable.
Add a new definition of variable .
def add_def(self, variable, location, size_threshold=32):
        """
        Add a new definition of variable.

        :param SimVariable variable: The variable being defined.
        :param CodeLocation location: Location of the varaible being defined.
        :param int size_threshold: The maximum bytes to consider for the variable.
        :return: True if the definition was new, False otherwise
        :rtype: bool
        """

        new_defs_added = False

        if isinstance(variable, SimRegisterVariable):
            if variable.reg is None:
                l.warning('add_def: Got a None for a SimRegisterVariable. Consider fixing.')
                return new_defs_added

            size = min(variable.size, size_threshold)
            offset = variable.reg
            while offset < variable.reg + size:
                if location not in self._register_map[offset]:
                    new_defs_added = True
                self._register_map[offset].add(location)
                offset += 1

            self._defs[variable].add(location)

        elif isinstance(variable, SimMemoryVariable):
            size = min(variable.size, size_threshold)
            offset = variable.addr
            while offset < variable.addr + size:
                if location not in self._memory_map[offset]:
                    new_defs_added = True
                self._memory_map[offset].add(location)
                offset += 1

            self._defs[variable].add(location)

        else:
            l.error('Unsupported variable type "%s".', type(variable))

        return new_defs_added
def add_def ( self , variable , location , size_threshold = 32 ) : new_defs_added = False if isinstance ( variable , SimRegisterVariable ) : if variable . reg is None : l . warning ( 'add_def: Got a None for a SimRegisterVariable. Consider fixing.' ) return new_defs_added size = min ( variable . size , size_threshold ) offset = variable . reg while offset < variable . reg + size : if location not in self . _register_map [ offset ] : new_defs_added = True self . _register_map [ offset ] . add ( location ) offset += 1 self . _defs [ variable ] . add ( location ) elif isinstance ( variable , SimMemoryVariable ) : size = min ( variable . size , size_threshold ) offset = variable . addr while offset < variable . addr + size : if location not in self . _memory_map [ offset ] : new_defs_added = True self . _memory_map [ offset ] . add ( location ) offset += 1 self . _defs [ variable ] . add ( location ) else : l . error ( 'Unsupported variable type "%s".' , type ( variable ) ) return new_defs_added