Class DebuggingFunction

    • Constructor Detail

      • DebuggingFunction

        public DebuggingFunction​(com.smeup.jardis.core.dap.model.Source source,
                                 DebuggingProgram program,
                                 String functionName,
                                 String callerName,
                                 Supplier<Integer> uniqueReferenceIdSupplier,
                                 com.smeup.rpgparser.interpreter.SystemInterface systemInterface,
                                 com.smeup.rpgparser.interpreter.ISymbolTable symbolTable,
                                 BiFunction<String,​com.smeup.rpgparser.interpreter.ISymbolTable,​com.smeup.rpgparser.parsing.ast.CompilationUnit> compilationUnitSupplier)
        Constructs a new DebuggingFunction instance, which extends the functionality of the AbstractDebuggingSource. The DebuggingFunction is used to represent a specific function in a debugging context.
        Parameters:
        source - the Source object representing the source information of the debugging function.
        program - the DebuggingProgram associated with this debugging function.
        functionName - the name of the function being debugged.
        callerName - the name of the caller associated with this debugging function.
        uniqueReferenceIdSupplier - the Supplier providing a unique reference ID for this debugging function.
        systemInterface - the SystemInterface providing system-level interaction capabilities for the debugging function.
        symbolTable - the ISymbolTable representing the symbol table associated with this debugging function.
        compilationUnitSupplier - the BiFunction responsible for creating a CompilationUnit using the function name and the symbol table.
    • Method Detail

      • getName

        public String getName()
        Retrieves the name of this debugging function. Combines the caller's name and the base name of the function.
        Specified by:
        getName in interface DebuggingSource
        Overrides:
        getName in class AbstractDebuggingSource
        Returns:
        the full name of the debugging function as a String, consisting of the caller's name followed by the function's base name.
      • setSource

        public void setSource​(com.smeup.jardis.core.dap.model.Source source)
        Updates the properties of the current source using the information provided in the given source.
        Parameters:
        source - the Source object containing updated information to set for the current source. It includes properties such as name, path, source reference, presentation hint, origin, associated sources, adapter data, and checksums.
      • setCallerName

        public void setCallerName​(String callerName)
        Sets the name of the caller for this debugging function.
        Parameters:
        callerName - the name of the caller to be associated with this function.
      • getBreakpoints

        public List<com.smeup.rpgparser.parsing.facade.SourceReference> getBreakpoints()
        Retrieves the list of breakpoints associated with this debugging function.
        Returns:
        a list of SourceReference objects representing the breakpoints.
      • getSourceReference

        public com.smeup.rpgparser.parsing.facade.SourceReference getSourceReference()
        Retrieves the current source reference in the debugging function.
        Returns:
        the SourceReference object representing the current line being debugged.
      • canBreak

        public boolean canBreak​(com.smeup.rpgparser.parsing.facade.SourceReference sourceReference)
        Determines whether a given source reference can be used as a valid breakpoint.
        Parameters:
        sourceReference - the SourceReference to check against the list of statements.
        Returns:
        true if the specified SourceReference is present in the list of statements, otherwise false.
      • getVariables

        public Map<Integer,​List<JarikoVariable>> getVariables()
        Retrieves a mapping of stack frame IDs to lists of JarikoVariable objects. Each stack frame ID is associated with a list of variables present in that frame.
        Returns:
        a Map where the keys are Integer stack frame IDs and the values are List objects containing JarikoVariable instances for the corresponding stack frame.
      • getProgram

        public DebuggingProgram getProgram()
        Retrieves the debugging program associated with this function.
        Returns:
        the DebuggingProgram object representing the associated program.
      • getProgramName

        public String getProgramName()
        Retrieves the name of the associated program.
        Returns:
        the name of the program as a String.
      • setVariable

        public String setVariable​(com.smeup.jardis.core.dap.model.SetVariableArguments setVariableArguments)
        Updates the value of a variable based on the given arguments.
        Parameters:
        setVariableArguments - The SetVariableArguments object containing the variable's reference, name, and the new value to assign.
        Returns:
        A string representation of the updated variable value if the operation was successful, or null if the variable could not be updated.
      • getIndicator

        public JarikoVariable getIndicator​(String indicatorName)
        Retrieves the indicator variable associated with the specified indicator name.
        Parameters:
        indicatorName - the name of the indicator to retrieve.
        Returns:
        the JarikoVariable corresponding to the specified indicator name.
      • setCurrentLine

        public void setCurrentLine​(com.smeup.rpgparser.parsing.facade.SourceReference currentLine)
        Sets the current source reference in the debugging function.
        Parameters:
        currentLine - the SourceReference representing the current line to be set.
      • setInterpreterCore

        public void setInterpreterCore​(com.smeup.rpgparser.interpreter.InterpreterCore interpreterCore)
        Sets the interpreter core for this debugging function.
        Parameters:
        interpreterCore - the InterpreterCore to be associated with the function, enabling execution and interpretation of the program.