Class SmapGenerator
java.lang.Object
org.ek9lang.compiler.backend.jvm.SmapGenerator
Generates JSR-45 SMAP (Source Map) for debugging non-Java languages on the JVM.
SMAP format enables debuggers to map JVM bytecode back to original .ek9 source files. This is critical for proper debugging support - without SMAP, debuggers expect .java files.
SMAP Structure:
SMAP GeneratedFileName LanguageName *S LanguageName *F + FileID FileName FilePath *L InputStartLine#FileID,InputLineCount:OutputStartLine,OutputLineIncrement *E
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSmapGenerator
(String generatedFileName) Create SMAP generator for a specific generated class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMapping
(DebugInfo debugInfo, int outputLineNumber) Add debug information from an IR instruction to the SMAP.void
collectFromIRConstruct
(IRConstruct construct) Collect all debug information from IR construct operations.generate()
Generate complete SMAP string in JSR-45 format.
-
Constructor Details
-
SmapGenerator
Create SMAP generator for a specific generated class.- Parameters:
generatedFileName
- The name of the generated .class file (without .class extension)
-
-
Method Details
-
addMapping
Add debug information from an IR instruction to the SMAP.- Parameters:
debugInfo
- Debug information from IRoutputLineNumber
- JVM bytecode line number
-
collectFromIRConstruct
Collect all debug information from IR construct operations.- Parameters:
construct
- IR construct containing operations with debug info
-
generate
Generate complete SMAP string in JSR-45 format.- Returns:
- SMAP string for SourceDebugExtension attribute
-