mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-27 00:11:22 +00:00
Debug (breakpoints, step) P-code for both AS1/2 and AS3
This commit is contained in:
@@ -65,7 +65,7 @@ public class FileTextWriter extends GraphTextWriter implements AutoCloseable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public FileTextWriter append(String str, long offset) {
|
||||
public FileTextWriter append(String str, long offset, long fileOffset) {
|
||||
writeToFile(str);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ public abstract class GraphTextWriter {
|
||||
|
||||
public abstract GraphTextWriter append(String str);
|
||||
|
||||
public abstract GraphTextWriter append(String str, long offset);
|
||||
public abstract GraphTextWriter append(String str, long offset, long fileOffset);
|
||||
|
||||
public abstract GraphTextWriter appendNoHilight(int i);
|
||||
|
||||
|
||||
@@ -202,6 +202,7 @@ public class HighlightedTextWriter extends GraphTextWriter {
|
||||
ndata.merge(itemPos.data);
|
||||
ndata.merge(data);
|
||||
ndata.offset = src.getOffset() + pos;
|
||||
ndata.fileOffset = src.getFileOffset();
|
||||
if (itemPos.startLineItem != null) {
|
||||
ndata.firstLineOffset = itemPos.startLineItem.getLineOffset();
|
||||
}
|
||||
@@ -217,11 +218,12 @@ public class HighlightedTextWriter extends GraphTextWriter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public HighlightedTextWriter append(String str, long offset) {
|
||||
public HighlightedTextWriter append(String str, long offset, long fileOffset) {
|
||||
Highlighting h = null;
|
||||
if (hilight) {
|
||||
HighlightData data = new HighlightData();
|
||||
data.offset = offset;
|
||||
data.fileOffset = fileOffset;
|
||||
h = new Highlighting(sb.length() - newLineCount, data, HighlightType.OFFSET, str);
|
||||
instructionHilights.add(h);
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ public class NulWriter extends GraphTextWriter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public NulWriter append(String str, long offset) {
|
||||
public NulWriter append(String str, long offset, long fileOffset) {
|
||||
stringAdded = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,8 @@ public class HighlightData implements Cloneable, Serializable {
|
||||
|
||||
public long offset;
|
||||
|
||||
public long fileOffset = -1;
|
||||
|
||||
public long firstLineOffset = -1;
|
||||
|
||||
public int regIndex = -1;
|
||||
@@ -46,7 +48,8 @@ public class HighlightData implements Cloneable, Serializable {
|
||||
public boolean isEmpty() {
|
||||
return !declaration && declaredType == null && localName == null
|
||||
&& subtype == null && specialValue == null
|
||||
&& index == 0 && offset == 0 && regIndex == -1 && firstLineOffset == -1;
|
||||
&& index == 0 && offset == 0 && regIndex == -1 && firstLineOffset == -1
|
||||
&& fileOffset == -1;
|
||||
}
|
||||
|
||||
public void merge(HighlightData data) {
|
||||
@@ -80,6 +83,9 @@ public class HighlightData implements Cloneable, Serializable {
|
||||
if (data.firstLineOffset != -1) {
|
||||
firstLineOffset = data.firstLineOffset;
|
||||
}
|
||||
if (data.fileOffset != -1) {
|
||||
fileOffset = data.fileOffset;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -100,7 +100,7 @@ public class Highlighting implements Serializable {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (pos == -1 || (pos >= h.startPos && (pos < h.startPos + h.len))) {
|
||||
if (pos == -1 || (pos >= h.startPos && ((h.len == 0 && pos == h.startPos) || pos < h.startPos + h.len))) {
|
||||
if (ret == null || h.startPos > ret.startPos) { //get the closest one
|
||||
ret = h;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user