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

Expose line-mapping for decompiled jars #95

Merged
merged 1 commit into from
Apr 24, 2021

Conversation

zml2008
Copy link
Collaborator

@zml2008 zml2008 commented Apr 24, 2021

This also fixes a case where the tracer wasn't incremented,
which caused misaligned linemaps.

I've tested this in my work on VanillaGradle, seems to make the debugger way happier now.

See VanillaGradle's implementation for an example of linemapping being applied.

There should be no impact on the decompiled output -- this whole bytecode tracer infrastructure is only used for the -bsm flag.

This fixes a case where the tracer wasn't incremented,
which caused misaligned linemaps
@LexManos
Copy link
Member

What is the use case? What does this actually do that is useful?

@zml2008
Copy link
Collaborator Author

zml2008 commented Apr 24, 2021

In an environment where you're not recompiling, this tells Fernflower to spit out a mapping of the lines in bytecode to lines in decompiled code. That is needed for breakpoints set based on the source in-IDE to match up with the code executed.

Without linemapping, method breakpoints will open up at (from our view) random points in the class file, and line breakpoints often won't trigger at all.

@LexManos
Copy link
Member

Interesting idea, this might be useful to provide MCPConfig builds, that do not have patches to make the code recompile.
Thanks for adding yet another thing onto my todo list ;)

@LexManos LexManos merged commit cbea449 into MinecraftForge:master Apr 24, 2021
@zml2008 zml2008 deleted the linemap branch April 24, 2021 03:44
jaskarth added a commit to jaskarth/quiltflower that referenced this pull request Apr 24, 2021
Upstream pull: MinecraftForge/ForgeFlower#95

Co-Authored-By: zml <629092+zml2008@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants