Module stm8dce.rel_analysis
This module provides classes and functions for analyzing .rel and .lib files
Classes
class Module
-
Class to represent a module in the .rel or .lib file.
Attributes
path
:str
- Path to the file containing the module.
line_number
:int
- Line number in the file where the module starts.
name
:str
- The name of the module.
referenced_symbols
:list
- Symbols referenced by this module.
defined_symbols
:list
- Symbols defined by this module.
referenced_by
:list
- ASM functions that reference this module.
references
:list
- ASM Functions or constants referenced by this module.
Initializes the Module with the given path and line_number.
Args
path
:str
- The file path of the module.
line_number
:int
- The line number in the file.
Methods
def __init__(self, path, line_number)
-
Initializes the Module with the given path and line_number.
Args
path
:str
- The file path of the module.
line_number
:int
- The line number in the file.
def __repr__(self)
-
Return repr(self).
def __str__(self)
-
Return str(self).
def add_defined_symbol(self, symbol)
-
Adds a symbol to the list of defined symbols.
Args
symbol
:str
- The symbol to add.
def add_referenced_symbol(self, symbol)
-
Adds a symbol to the list of referenced symbols.
Args
symbol
:str
- The symbol to add.
def print(self)
-
Prints the details of the module.
def resolve_references(self, keep_functions, all_functions, all_constants)
-
Resolves references for the module. Resolving means: - Find the functions that reference this module's defined symbols - Find the functions and constants that this module references
Args
functions
:list
- List of all function objects.
constants
:list
- List of all constant objects.
def set_name(self, name)
-
Sets the name of the module.
Args
name
:str
- The name to set for the module.