mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-169057 Emulated method breakpoints does not work with decompiled code
This commit is contained in:
@@ -590,13 +590,13 @@ public abstract class DebuggerUtilsEx extends DebuggerUtils {
|
||||
return new SigReader(s).getSignature();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Nullable
|
||||
public static List<Location> allLineLocations(Method method) {
|
||||
try {
|
||||
return method.allLineLocations();
|
||||
}
|
||||
catch (AbsentInformationException ignored) {
|
||||
return Collections.emptyList();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ public class MethodBytecodeUtil {
|
||||
dos.write(bytecodes); // code
|
||||
dos.writeShort(0); // exception_table_length
|
||||
List<Location> locations = withLineNumbers ? DebuggerUtilsEx.allLineLocations(method) : Collections.emptyList();
|
||||
if (!locations.isEmpty()) {
|
||||
if (!ContainerUtil.isEmpty(locations)) {
|
||||
dos.writeShort(1); // attributes_count
|
||||
dos.writeShort(cw.newUTF8("LineNumberTable"));
|
||||
dos.writeInt(2 * locations.size() + 2);
|
||||
|
||||
@@ -200,17 +200,21 @@ public class MethodBreakpoint extends BreakpointWithHighlighter<JavaMethodBreakp
|
||||
boolean found = false;
|
||||
for (Method method : methods) {
|
||||
found = true;
|
||||
if (base && method.isNative()) {
|
||||
if (method.isNative()) {
|
||||
breakpoint.disableEmulation();
|
||||
return;
|
||||
}
|
||||
Method target = MethodBytecodeUtil.getBridgeTargetMethod(method, debugProcess.getVirtualMachineProxy());
|
||||
if (target != null && !DebuggerUtilsEx.allLineLocations(target).isEmpty()) {
|
||||
if (target != null && !ContainerUtil.isEmpty(DebuggerUtilsEx.allLineLocations(target))) {
|
||||
method = target;
|
||||
}
|
||||
|
||||
List<Location> allLineLocations = DebuggerUtilsEx.allLineLocations(method);
|
||||
if (!allLineLocations.isEmpty()) {
|
||||
if (allLineLocations == null) { // no line numbers
|
||||
breakpoint.disableEmulation();
|
||||
return;
|
||||
}
|
||||
if (!ContainerUtil.isEmpty(allLineLocations)) {
|
||||
if (breakpoint.isWatchEntry()) {
|
||||
createLocationBreakpointRequest(breakpoint, ContainerUtil.getFirstItem(allLineLocations), debugProcess);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user