mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 11:53:49 +07:00
[debugger] fix method breakpoint for bridge methods, EA-962879
Bridge method might target to abstract/native method. GitOrigin-RevId: cd408645092e08e5549262ba0a4bc15bd5b58c9f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b4d12c1883
commit
b2bda76ce3
@@ -198,22 +198,21 @@ public class MethodBreakpoint extends BreakpointWithHighlighter<JavaMethodBreakp
|
||||
? StreamEx.of(lambdaMethod)
|
||||
: breakpoint.matchingMethods(StreamEx.of(classType.methods()).filter(m -> base || !m.isAbstract()), debugProcess);
|
||||
boolean found = false;
|
||||
for (Method method : methods) {
|
||||
for (Method original : methods) {
|
||||
found = true;
|
||||
|
||||
Method bridgeTarget = MethodBytecodeUtil.getBridgeTargetMethod(original, classesByName);
|
||||
Method method = bridgeTarget != null ? bridgeTarget : original;
|
||||
|
||||
if (method.isNative()) {
|
||||
LOG.info("Breakpoint emulation was disabled because " + method + " is native");
|
||||
breakpoint.disableEmulation();
|
||||
return;
|
||||
}
|
||||
else if (method.isAbstract()) {
|
||||
if (method.isAbstract()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Method target = MethodBytecodeUtil.getBridgeTargetMethod(method, classesByName);
|
||||
if (target != null) {
|
||||
method = target;
|
||||
}
|
||||
|
||||
if (breakpoint.isWatchEntry()) {
|
||||
// We assume that all VMs start code indexes from zero.
|
||||
Location location = new LocationCodeIndexOnly(method, 0);
|
||||
@@ -221,7 +220,6 @@ public class MethodBreakpoint extends BreakpointWithHighlighter<JavaMethodBreakp
|
||||
}
|
||||
|
||||
if (breakpoint.isWatchExit()) {
|
||||
final Method finalMethod = method;
|
||||
class BytecodeVisitor extends MethodVisitor implements MethodBytecodeUtil.InstructionOffsetReader {
|
||||
private int bytecodeOffset = -1;
|
||||
|
||||
@@ -238,7 +236,7 @@ public class MethodBreakpoint extends BreakpointWithHighlighter<JavaMethodBreakp
|
||||
public void visitInsn(int opcode) {
|
||||
if (Opcodes.IRETURN <= opcode && opcode <= Opcodes.RETURN) {
|
||||
assert bytecodeOffset >= 0;
|
||||
Location location = new LocationCodeIndexOnly(finalMethod, bytecodeOffset);
|
||||
Location location = new LocationCodeIndexOnly(method, bytecodeOffset);
|
||||
createLocationBreakpointRequest(breakpoint, location, debugProcess, false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user