IDEA-127182 (passing line number map to debugger)
This commit is contained in:
@@ -181,7 +181,7 @@ public class ConsoleDecompiler implements IBytecodeProvider, IResultSaver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveClassFile(String path, String qualifiedName, String entryName, String content) {
|
public void saveClassFile(String path, String qualifiedName, String entryName, String content, int[] mapping) {
|
||||||
File file = new File(getAbsolutePath(path), entryName);
|
File file = new File(getAbsolutePath(path), entryName);
|
||||||
try {
|
try {
|
||||||
Writer out = new OutputStreamWriter(new FileOutputStream(file), "UTF8");
|
Writer out = new OutputStreamWriter(new FileOutputStream(file), "UTF8");
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public interface IResultSaver {
|
|||||||
|
|
||||||
void copyFile(String source, String path, String entryName);
|
void copyFile(String source, String path, String entryName);
|
||||||
|
|
||||||
void saveClassFile(String path, String qualifiedName, String entryName, String content);
|
void saveClassFile(String path, String qualifiedName, String entryName, String content, int[] mapping);
|
||||||
|
|
||||||
void createArchive(String path, String archiveName, Manifest manifest);
|
void createArchive(String path, String archiveName, Manifest manifest);
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.jetbrains.java.decompiler.struct;
|
package org.jetbrains.java.decompiler.struct;
|
||||||
|
|
||||||
|
import org.jetbrains.java.decompiler.main.DecompilerContext;
|
||||||
|
import org.jetbrains.java.decompiler.main.extern.IFernflowerPreferences;
|
||||||
import org.jetbrains.java.decompiler.main.extern.IResultSaver;
|
import org.jetbrains.java.decompiler.main.extern.IResultSaver;
|
||||||
import org.jetbrains.java.decompiler.struct.lazy.LazyLoader;
|
import org.jetbrains.java.decompiler.struct.lazy.LazyLoader;
|
||||||
import org.jetbrains.java.decompiler.struct.lazy.LazyLoader.Link;
|
import org.jetbrains.java.decompiler.struct.lazy.LazyLoader.Link;
|
||||||
@@ -112,7 +114,11 @@ public class ContextUnit {
|
|||||||
if (entryName != null) {
|
if (entryName != null) {
|
||||||
String content = decompiledData.getClassContent(cl);
|
String content = decompiledData.getClassContent(cl);
|
||||||
if (content != null) {
|
if (content != null) {
|
||||||
resultSaver.saveClassFile(filename, cl.qualifiedName, entryName, content);
|
int[] mapping = null;
|
||||||
|
if (DecompilerContext.getOption(IFernflowerPreferences.BYTECODE_SOURCE_MAPPING)) {
|
||||||
|
mapping = DecompilerContext.getBytecodeSourceMapper().getOriginalLinesMapping();
|
||||||
|
}
|
||||||
|
resultSaver.saveClassFile(filename, cl.qualifiedName, entryName, content, mapping);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user