Class DebuggingFunction
- java.lang.Object
-
- com.smeup.jardis.jariko.dap.model.AbstractDebuggingSource
-
- com.smeup.jardis.jariko.dap.model.DebuggingFunction
-
- All Implemented Interfaces:
DebuggingSource
public class DebuggingFunction extends AbstractDebuggingSource
- Author:
- Davide Palladino (APU001)
-
-
Field Summary
-
Fields inherited from class com.smeup.jardis.jariko.dap.model.AbstractDebuggingSource
uniqueReferenceIdSupplier
-
-
Constructor Summary
Constructors Constructor Description 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 newDebuggingFunctioninstance, which extends the functionality of theAbstractDebuggingSource.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanBreak(com.smeup.rpgparser.parsing.facade.SourceReference sourceReference)Determines whether a given source reference can be used as a valid breakpoint.List<com.smeup.rpgparser.parsing.facade.SourceReference>getBreakpoints()Retrieves the list of breakpoints associated with this debugging function.JarikoVariablegetIndicator(String indicatorName)Retrieves the indicator variable associated with the specified indicator name.StringgetName()Retrieves the name of this debugging function.DebuggingProgramgetProgram()Retrieves the debugging program associated with this function.StringgetProgramName()Retrieves the name of the associated program.com.smeup.rpgparser.parsing.facade.SourceReferencegetSourceReference()Retrieves the current source reference in the debugging function.Map<Integer,List<JarikoVariable>>getVariables()Retrieves a mapping of stack frame IDs to lists ofJarikoVariableobjects.voidsetCallerName(String callerName)Sets the name of the caller for this debugging function.voidsetCurrentLine(com.smeup.rpgparser.parsing.facade.SourceReference currentLine)Sets the current source reference in the debugging function.voidsetInterpreterCore(com.smeup.rpgparser.interpreter.InterpreterCore interpreterCore)Sets the interpreter core for this debugging function.voidsetSource(com.smeup.jardis.core.dap.model.Source source)Updates the properties of the current source using the information provided in the given source.StringsetVariable(com.smeup.jardis.core.dap.model.SetVariableArguments setVariableArguments)Updates the value of a variable based on the given arguments.-
Methods inherited from class com.smeup.jardis.jariko.dap.model.AbstractDebuggingSource
getSource, getStackFrameId, getUniqueReferenceId, toString
-
-
-
-
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 newDebuggingFunctioninstance, which extends the functionality of theAbstractDebuggingSource. TheDebuggingFunctionis used to represent a specific function in a debugging context.- Parameters:
source- theSourceobject representing the source information of the debugging function.program- theDebuggingProgramassociated with this debugging function.functionName- the name of the function being debugged.callerName- the name of the caller associated with this debugging function.uniqueReferenceIdSupplier- theSupplierproviding a unique reference ID for this debugging function.systemInterface- theSystemInterfaceproviding system-level interaction capabilities for the debugging function.symbolTable- theISymbolTablerepresenting the symbol table associated with this debugging function.compilationUnitSupplier- theBiFunctionresponsible for creating aCompilationUnitusing 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:
getNamein interfaceDebuggingSource- Overrides:
getNamein classAbstractDebuggingSource- 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- theSourceobject 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
SourceReferenceobjects representing the breakpoints.
-
getSourceReference
public com.smeup.rpgparser.parsing.facade.SourceReference getSourceReference()
Retrieves the current source reference in the debugging function.- Returns:
- the
SourceReferenceobject 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- theSourceReferenceto check against the list of statements.- Returns:
trueif the specifiedSourceReferenceis present in the list of statements, otherwisefalse.
-
getVariables
public Map<Integer,List<JarikoVariable>> getVariables()
Retrieves a mapping of stack frame IDs to lists ofJarikoVariableobjects. Each stack frame ID is associated with a list of variables present in that frame.- Returns:
- a
Mapwhere the keys areIntegerstack frame IDs and the values areListobjects containingJarikoVariableinstances for the corresponding stack frame.
-
getProgram
public DebuggingProgram getProgram()
Retrieves the debugging program associated with this function.- Returns:
- the
DebuggingProgramobject 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- TheSetVariableArgumentsobject 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
nullif 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
JarikoVariablecorresponding 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- theSourceReferencerepresenting 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- theInterpreterCoreto be associated with the function, enabling execution and interpretation of the program.
-
-