Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodeAPI generated bytecode debugging #1

Closed
JonathanxD opened this issue Dec 31, 2016 · 0 comments
Closed

CodeAPI generated bytecode debugging #1

JonathanxD opened this issue Dec 31, 2016 · 0 comments

Comments

@JonathanxD
Copy link
Collaborator

JonathanxD commented Dec 31, 2016

To debug classes generated by BytecodeGenerator you should to enable the VISIT_LINES option:

BytecodeGenerator generator = ...
bytecodeGenerator.getOptions().set(BytecodeOptions.VISIT_LINES, VisitLineType.FOLLOW_CODE_SOURCE);

There's three types of line visit:

  • DISABLED
    • Disable the line visit (default)
  • INCREMENTAL
    • Incremental, for each expression visit a line
  • FOLLOW_CODE_SOURCE
    • Follow the code source order, for each CodeSource index visit a line (when a CodeSource is found inside another CodeSource, the line visitor will apply a offset).

After defining the VISIT_LINES option, the BytecodeVisitor will visit lines, and these lines can be found in the disassembled bytecode class (BytecodeClass.disassembledCode).

@JonathanxD JonathanxD changed the title Error debugging Debugging Dec 31, 2016
@JonathanxD JonathanxD changed the title Debugging CodeAPI generated bytecode debugging Dec 31, 2016
@koresframework koresframework locked and limited conversation to collaborators Jan 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant