Skip to content

Commit

Permalink
Add some debugging niceties and fix some J21 errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
LexManos committed Apr 18, 2024
1 parent a2946bc commit d9681ad
Show file tree
Hide file tree
Showing 6 changed files with 926 additions and 9 deletions.
9 changes: 5 additions & 4 deletions FernFlower-Patches/0038-Make-decomp-threaded.patch
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ index 981fae680b021336d77a685d5512e77d94d842f8..bfd9372cd9c5b8a2f7e6714cb63b13b0
defaults.put(LOG_LEVEL, IFernflowerLogger.Severity.INFO.name());
defaults.put(MAX_PROCESSING_METHOD, "0");
diff --git a/src/org/jetbrains/java/decompiler/struct/ContextUnit.java b/src/org/jetbrains/java/decompiler/struct/ContextUnit.java
index 7b0946ed0de6af2dbe2043332650a09880027726..7d44617f437ad6e78e204d56c394be5e0d5962c4 100644
index 7b0946ed0de6af2dbe2043332650a09880027726..b097768a602ed73aa4079e8097d1eb707442394f 100644
--- a/src/org/jetbrains/java/decompiler/struct/ContextUnit.java
+++ b/src/org/jetbrains/java/decompiler/struct/ContextUnit.java
@@ -14,8 +14,14 @@ import java.io.IOException;
Expand Down Expand Up @@ -711,7 +711,7 @@ index 7b0946ed0de6af2dbe2043332650a09880027726..7d44617f437ad6e78e204d56c394be5e
if (content != null) {
int[] mapping = null;
if (DecompilerContext.getOption(IFernflowerPreferences.BYTECODE_SOURCE_MAPPING)) {
@@ -149,13 +158,51 @@ public class ContextUnit {
@@ -149,13 +158,52 @@ public class ContextUnit {
}
}

Expand Down Expand Up @@ -756,6 +756,7 @@ index 7b0946ed0de6af2dbe2043332650a09880027726..7d44617f437ad6e78e204d56c394be5e
+ futures.add(executor.submit(() -> {
+ DecompilerContext.setCurrentContext(clCtx.ctx);
+ clCtx.classContent = decompiledData.getClassContent(clCtx.cl);
+ clCtx.shouldContinue = clCtx.classContent != null;
+ DecompilerContext.setCurrentContext(null);
+ }));
+ }
Expand All @@ -769,7 +770,7 @@ index 7b0946ed0de6af2dbe2043332650a09880027726..7d44617f437ad6e78e204d56c394be5e
}
}

@@ -164,6 +211,16 @@ public class ContextUnit {
@@ -164,6 +212,16 @@ public class ContextUnit {
}
}

Expand All @@ -786,7 +787,7 @@ index 7b0946ed0de6af2dbe2043332650a09880027726..7d44617f437ad6e78e204d56c394be5e
public void setManifest(Manifest manifest) {
this.manifest = manifest;
}
@@ -175,4 +232,18 @@ public class ContextUnit {
@@ -175,4 +233,18 @@ public class ContextUnit {
public List<StructClass> getClasses() {
return classes;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,20 +211,20 @@ index cf03900654e427bd435ba6dc2d5a0cec8c8708e4..017d3975a3cbe06e485b65ca1b75d6c6
+ }
}
diff --git a/src/org/jetbrains/java/decompiler/struct/ContextUnit.java b/src/org/jetbrains/java/decompiler/struct/ContextUnit.java
index 7d44617f437ad6e78e204d56c394be5e0d5962c4..32a48812223687f21030a448926e45a3f89061cb 100644
index b097768a602ed73aa4079e8097d1eb707442394f..875ba77596a678d7d76b6422e761840773b5d85b 100644
--- a/src/org/jetbrains/java/decompiler/struct/ContextUnit.java
+++ b/src/org/jetbrains/java/decompiler/struct/ContextUnit.java
@@ -193,6 +193,9 @@ public class ContextUnit {
futures.add(executor.submit(() -> {
@@ -194,6 +194,9 @@ public class ContextUnit {
DecompilerContext.setCurrentContext(clCtx.ctx);
clCtx.classContent = decompiledData.getClassContent(clCtx.cl);
clCtx.shouldContinue = clCtx.classContent != null;
+ if (DecompilerContext.getOption(IFernflowerPreferences.BYTECODE_SOURCE_MAPPING)) {
+ clCtx.mapping = DecompilerContext.getBytecodeSourceMapper().getOriginalLinesMapping();
+ }
DecompilerContext.setCurrentContext(null);
}));
}
@@ -202,7 +205,7 @@ public class ContextUnit {
@@ -203,7 +206,7 @@ public class ContextUnit {

for (final ClassContext clCtx : toProcess) {
if (clCtx.shouldContinue) {
Expand All @@ -233,7 +233,7 @@ index 7d44617f437ad6e78e204d56c394be5e0d5962c4..32a48812223687f21030a448926e45a3
}
}

@@ -239,6 +242,7 @@ public class ContextUnit {
@@ -240,6 +243,7 @@ public class ContextUnit {
public boolean shouldContinue;
public DecompilerContext ctx;
String classContent;
Expand Down

0 comments on commit d9681ad

Please sign in to comment.