Summary: | Eclipse debugger fails on BCEL-instrumented methods having generic local variables. | ||
---|---|---|---|
Product: | BCEL - Now in Jira | Reporter: | Byron Hawkins <byron> |
Component: | Main | Assignee: | issues <issues> |
Status: | NEW --- | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All |
Description
Byron Hawkins
2011-09-12 04:17:32 UTC
Here is an icky workaround: Method method = <initialize>; MethodGen methodGenerator = new MethodGen(method, ...); InstructionList instructions = methodGenerator.getInstructionList(); Map<Integer, InstructionHandle> handlesByPosition = new HashMap<Integer, InstructionHandle>(); for (InstructionHandle handle : instructions.getInstructionHandles()) { handlesByPosition.put(handle.getPosition(), handle); } if (method.getLocalVariableTable() != null) { methodGenerator.removeLocalVariables(); for (LocalVariable local : method.getLocalVariableTable().getLocalVariableTable()) { methodGenerator.addLocalVariable(local.getName(), Type.getType(local.getSignature()), local.getIndex(), handlesByPosition.get(local.getStartPC()), handlesByPosition.get(local.getStartPC() + local.getLength())); } } |