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

Enable access to stacked return value in AT EXIT rules by binding $! to reference it

XMLWordPrintable

      I have an AT EXIT rule and needed to BIND to the returned value. Nothing in the docs told me this was possible. I was going to go into the code and see if I can implement it, but I came across this:

      } else if (name.equals("$$"))

      { // $$ references the helper implicitly associated with a builtin call index = HELPER; }

      else if (name.equals("$!")) {
      // $! refers to the current return value for the triggger method and is only valid when
      // the rule is triggered AT EXIT
      index = RETURN;

      So it looks like this is already supported! Yea for me.

      This JIRA is to ensure that $! gets documented in the Byteman user guide. I also see that $$ is an undocumented feature too - should mention that one as well in the docs.

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

                Created:
                Updated:
                Resolved: