Uploaded image for project: 'Byteman'
  1. Byteman
  2. BYTEMAN-124

Byteman faisl to handle classes whose method empoy JSR/RET

    XMLWordPrintable

Details

    Description

      The latest Byteman release employs the COMPUTE_FRAMES option provided by the ASM ClassWriter. This was necessary in order for the code generaor to be able to allocate local stack slots. This causes the class writer option inserts details of the stack frame layout into the generated bytecode. This is needed because without the option multiple passes over th ebytecode to inject successive rules will fail due to lack of information about the stack layout changes introduced by Byteman.

      Unfortunately, it is illegal to write fraem info into any code which employs the (legacy) JSR instruction. The stack layout when the JSR target is reached is undefined since the layout at the point where JSR is called need not be the same). As a consequence ASM throws an exception if a transformed class ahppens to contain a JSR and this means Byteman cannot transform such classes. So, for example, a rule which tries to inject code into SocketInputStream will fail to work.

      A possible solution is to inline the JSR code using the JSRInlinerAdapter class provided as part of ASM.

      Attachments

        Activity

          People

            rhn-engineering-adinn Andrew Dinn
            rhn-engineering-adinn Andrew Dinn
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: