From 7f3c2a116afb84aa670b4bfc14e4907326cdeef4 Mon Sep 17 00:00:00 2001 From: Patrick Pedersen Date: Sun, 23 Jun 2024 03:23:17 +0200 Subject: [PATCH] Docs: Updated Signed-off-by: Patrick Pedersen --- docs/stm8dce/asm_analysis.html | 84 +++++++++++++++++++++++++++++++++- docs/stm8dce/asm_matchers.html | 53 ++++++++++++++++----- docs/stm8dce/asm_parser.html | 24 ++++++++++ docs/stm8dce/index.html | 6 +-- docs/stm8dce/rel_analysis.html | 68 +++++++++++++++++++++++++-- docs/stm8dce/rel_matchers.html | 6 +-- 6 files changed, 217 insertions(+), 24 deletions(-) diff --git a/docs/stm8dce/asm_analysis.html b/docs/stm8dce/asm_analysis.html index b7bcce0..e2c07cb 100644 --- a/docs/stm8dce/asm_analysis.html +++ b/docs/stm8dce/asm_analysis.html @@ -137,6 +137,24 @@

Returns

List of matching Function objects.
+
+def initializers_referencing_external(initializers, external_symbol) +
+
+

Returns a list of initializer objects referencing an external symbol.

+

Args

+
+
initializers : list
+
List of Initializer objects.
+
external_symbol : str
+
Name of the external symbol to match.
+
+

Returns

+
+
list
+
List of matching Initializer objects.
+
+
def interrupt_handlers(functions)
@@ -183,8 +201,8 @@

Classes

Class to store constant definitions.

Input Attributes: path (str): Path of the file the constant is defined in. -name (str): Name of the constant. start_line_number (int): Start line of the constant. +name (str): Name of the constant. end_line_number (int): End line of the constant.

Generated Attributes: global_defs (list): List of resolved global definitions associated with the constant (See resolve_globals).

@@ -236,14 +254,16 @@

Args

Class to store function definitions.

Input Attributes: path (str): Path of the file the function is defined in. -name (str): Name of the function. start_line_number (int): Start line of the function. +name (str): Name of the function. end_line_number (int): End line of the function. calls_str (list): List of calls made by the function. long_read_labels_str (list): List of long read labels.

Generated Attributes: calls (list): List of resolved functions called by the function (See resolve_calls). +external_calls (list): List of external functions (in rel & lib files) called by the function. constants (list): List of resolved constants read by the function (See resolve_constants). +external_constants (list): List of external constants (in rel & lib files) read by the function. global_defs (list): List of resolved global definitions used by the function (See resolve_globals). fptrs (list): List of resolved function pointers assigned by the function (See resolve_fptrs). isr_def (IntDef): Resolved interrupt definition associated with the function (See resolve_isr). @@ -378,6 +398,55 @@

Methods

+
+class Initializer +
+
+

Class to store initializer definitions.

+

Input Attributes: +path (str): Path of the file the initializer is defined in. +start_line_number (int): Start line of the initializer. +name (str): Name of the initializer. +end_line_number (int): End line of the initializer. +pointers_str (list): List of pointers defined by the initializer. Pointers store absolute labels.

+

Generated Attributes: +pointers (list): List of resolved pointers associated with the initializer (See resolve_pointers).

+

The intended use of this class is to first parse the input attributes and then call the resolve_* functions

+

Methods

+
+
+def __init__(self, path, start_line_number, name) +
+
+

Initialize self. +See help(type(self)) for accurate signature.

+
+
+def __repr__(self) +
+
+

Return repr(self).

+
+
+def __str__(self) +
+
+

Return str(self).

+
+
+def print(self) +
+
+

Prints the details of the initializer.

+
+
+def resolve_pointers(self, functions, constants) +
+
+
+
+
+
class IntDef
@@ -443,6 +512,7 @@

Index

  • function_by_filename_name
  • functions_by_name
  • functions_referencing_external
  • +
  • initializers_referencing_external
  • interrupt_handlers
  • traverse_calls
  • @@ -483,6 +553,16 @@

    Initializer

    + + +
  • IntDef

    • __init__
    • diff --git a/docs/stm8dce/asm_matchers.html b/docs/stm8dce/asm_matchers.html index 47c32e8..ea16a3d 100644 --- a/docs/stm8dce/asm_matchers.html +++ b/docs/stm8dce/asm_matchers.html @@ -5,7 +5,7 @@ stm8dce.asm_matchers API documentation - + @@ -22,7 +22,7 @@

      Module stm8dce.asm_matchers

      -

      This module provides functions to pattern match STM8 SDCC generated assembly code.

      +

      This module provides classes and functions to pattern match STM8 SDCC generated assembly code.

      @@ -81,7 +81,7 @@

      Classes

      (*args, **kwds)
      -

      Enum to represent different types of areas in assembly code.

      +

      Enum to represent relevant types of areas in assembly code.

      Ancestors

      • enum.Enum
      • @@ -180,7 +180,7 @@

        Args

        Static methods

        -def is_area_directive(eval, area_type=None) +def is_area_directive(eval, area_name=None)

        Static method to check if an instance is a Directive and is an area directive.

        @@ -188,13 +188,29 @@

        Args

        eval
        The instance to check.
        -
        area_type : AreaType, optional
        -
        The area type to check for.
        +
        area_name : str, optional
        +
        The area to check for.

        Returns

        bool
        -
        True if the instance is a Directive and is an area directive (and matches the area type, if provided), False otherwise.
        +
        True if the instance is a Directive and is an area directive (and matches the area, if provided), False otherwise.
        +
        +
        +
        +def is_dw_directive(eval) +
        +
        +

        Static method to check if an instance is a Directive and is a .dw directive.

        +

        Args

        +
        +
        eval
        +
        The instance to check.
        +
        +

        Returns

        +
        +
        bool
        +
        True if the instance is a Directive and is a .dw directive, False otherwise.
        @@ -244,19 +260,30 @@

        Args

        Return str(self).

      -def is_area(self, area_type=None) +def is_area(self, area_name=None)
      -

      Checks if the directive is an area directive, optionally of a specific area type.

      +

      Checks if the directive is an area directive, optionally of a specific area.

      Args

      -
      area_type : AreaType, optional
      -
      The area type to check for.
      +
      area_name : str, optional
      +
      The area to check for.

      Returns

      bool
      -
      True if the directive is an area directive (and matches the area type, if provided), False otherwise.
      +
      True if the directive is an area directive (and matches the area, if provided), False otherwise.
      +
      +
      +
      +def is_dw(self) +
      +
      +

      Checks if the directive is a .dw directive.

      +

      Returns

      +
      +
      bool
      +
      True if the directive is a .dw directive, False otherwise.
      @@ -638,6 +665,8 @@

      __str__
    • is_area
    • is_area_directive
    • +
    • is_dw
    • +
    • is_dw_directive
    • is_global
    • is_global_directive
    diff --git a/docs/stm8dce/asm_parser.html b/docs/stm8dce/asm_parser.html index c504e4b..0b93f94 100644 --- a/docs/stm8dce/asm_parser.html +++ b/docs/stm8dce/asm_parser.html @@ -119,6 +119,28 @@

    Args

    The label indicating the start of the function.
  • +
    +def _parse_initializer(self, label) +
    +
    +

    Parses an initializer and extracts relevant information.

    +

    Args

    +
    +
    label : Label
    +
    The label indicating the start of the initializer.
    +
    +
    +
    +def _parse_initializer_section(self, area) +
    +
    +

    Parses the initializer section of the file.

    +

    Args

    +
    +
    area : Directive
    +
    The directive indicating the start of the initializer section.
    +
    +
    @@ -146,6 +168,8 @@

    _parse_const_section
  • _parse_constant
  • _parse_function
  • +
  • _parse_initializer
  • +
  • _parse_initializer_section
  • diff --git a/docs/stm8dce/index.html b/docs/stm8dce/index.html index 3aa0e7f..eacf402 100644 --- a/docs/stm8dce/index.html +++ b/docs/stm8dce/index.html @@ -33,7 +33,7 @@

    Sub-modules

    stm8dce.asm_matchers
    -

    This module provides functions to pattern match STM8 SDCC generated assembly code.

    +

    This module provides classes and functions to pattern match STM8 SDCC generated assembly code.

    stm8dce.asm_parser
    @@ -49,8 +49,8 @@

    Sub-modules

    stm8dce.rel_matchers
    -

    This module provides functions to pattern match STM8 SDCC generated .rel and .lib files. -For more information on the STM8 .rel and .lib file formats, …

    +

    This module provides classes and function to pattern match STM8 SDCC generated .rel and .lib files. +For more information on the STM8 .rel and .lib …

    stm8dce.rel_parser
    diff --git a/docs/stm8dce/rel_analysis.html b/docs/stm8dce/rel_analysis.html index 16235d2..4b6b264 100644 --- a/docs/stm8dce/rel_analysis.html +++ b/docs/stm8dce/rel_analysis.html @@ -29,6 +29,27 @@

    Module stm8dce.rel_analysis

    +

    Functions

    +
    +
    +def modules_by_defined_symbol(modules, symbol_name) +
    +
    +

    Returns a list of modules that define the given symbol.

    +

    Args

    +
    +
    modules : list
    +
    List of Module objects.
    +
    symbol_name : str
    +
    The symbol to search for.
    +
    +

    Returns

    +
    +
    list
    +
    List of modules that define the symbol.
    +
    +
    +

    Classes

    @@ -118,19 +139,51 @@

    Args

    Prints the details of the module.

    +
    +def resolve_incoming_references(self, keep_functions, all_initializers) +
    +
    +

    Resolves incoming references for the module. +This means finding the functions that reference this module's defined symbols.

    +

    Args

    +
    +
    keep_functions : list
    +
    List of kept function objects.
    +
    all_initializers : list
    +
    List of all initializer objects.
    +
    +
    +
    +def resolve_outgoing_references(self, all_functions, all_constants) +
    +
    +

    Resolves outgoing references for the module. +This means finding the functions and constants that this module references.

    +

    Args

    +
    +
    all_functions : list
    +
    List of all function objects.
    +
    all_constants : list
    +
    List of all constant objects.
    +
    +
    -def resolve_references(self, keep_functions, all_functions, all_constants) +def resolve_references(self, keep_functions, all_initializers, all_functions, all_constants)
    -

    Resolves references for the module. +

    Resolves references for the module by calling incoming and outgoing reference resolvers. Resolving means: - Find the functions that reference this module's defined symbols - Find the functions and constants that this module references

    Args

    -
    functions : list
    +
    keep_functions : list
    +
    List of kept function objects.
    +
    all_initializers : list
    +
    List of all initializer objects.
    +
    all_functions : list
    List of all function objects.
    -
    constants : list
    +
    all_constants : list
    List of all constant objects.
    @@ -161,6 +214,11 @@

    Index

  • stm8dce
  • +
  • Functions

    + +
  • Classes

    diff --git a/docs/stm8dce/rel_matchers.html b/docs/stm8dce/rel_matchers.html index e4ccef8..8255a2a 100644 --- a/docs/stm8dce/rel_matchers.html +++ b/docs/stm8dce/rel_matchers.html @@ -5,8 +5,8 @@ stm8dce.rel_matchers API documentation - + @@ -23,7 +23,7 @@

    Module stm8dce.rel_matchers

    -

    This module provides functions to pattern match STM8 SDCC generated .rel and .lib files. +

    This module provides classes and function to pattern match STM8 SDCC generated .rel and .lib files. For more information on the STM8 .rel and .lib file formats, see: https://sourceforge.net/p/sdcc/code/HEAD/tree/trunk/sdcc/sdas/doc/format.txt