jakarta-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 51801] Eclipse debugger fails on BCEL-instrumented methods having generic local variables.
Date Mon, 12 Sep 2011 06:12:00 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=51801

Byron Hawkins <byron@hawkinssoftware.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|                            |All

--- Comment #1 from Byron Hawkins <byron@hawkinssoftware.net> 2011-09-12 06:12:00 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()));
            }
        }

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org


Mime
View raw message