Class DebugGenerators
java.lang.Object
com.offbynull.coroutines.instrumenter.generators.DebugGenerators
Utility class to generate bytecode instructions that help debug instrumented code.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.objectweb.asm.tree.InsnList
debugMarker
(DebugGenerators.MarkerType markerType, String text) Generates instructions for generating marker instructions.static org.objectweb.asm.tree.InsnList
debugPrint
(org.objectweb.asm.tree.InsnList text) Generates instructions for printing out a string usingSystem.out
.
-
Constructor Details
-
DebugGenerators
private DebugGenerators()
-
-
Method Details
-
debugMarker
public static org.objectweb.asm.tree.InsnList debugMarker(DebugGenerators.MarkerType markerType, String text) Generates instructions for generating marker instructions. These marker instructions are meant to be is useful for debugging instrumented code. For example, you can spot a specific portion of instrumented code by looking for specific markers in the assembly output.- Parameters:
markerType
- marker type (determines what kind of instructions are generated)text
- text to print out- Returns:
- instructions to call System.out.println with a string constant
- Throws:
NullPointerException
- if any argument isnull
-
debugPrint
public static org.objectweb.asm.tree.InsnList debugPrint(org.objectweb.asm.tree.InsnList text) Generates instructions for printing out a string usingSystem.out
. This is useful for debugging. For example, you can print out lines around your instrumented code to make sure that what you think is being run is actually being run.- Parameters:
text
- debug text generation instruction list -- must leave a String on the stack- Returns:
- instructions to call System.out.println with a string constant
- Throws:
NullPointerException
- if any argument isnull
-