Instrument at marked locations
"ThanhVu (Vu) Nguyen" <[email protected]> Wed, 29 Nov 2017 23:03:44 +0000
| Newsgroups | gmane.comp.java.objectweb.asm |
|---|---|
| Message-ID | <CA+OL+MiLQzdP8amES-psvf6NfHTVRQjxuwqPg+0EBS_nn=fTJQ@mail.gmail.com> |
Hi all,
I want to use ASM to instrument program at certain marked locations.
For example, in my original program, I might have
...
somecode
//@trace: int x, int y, int z
some more code
...
I want to use ASM to instrument code at the trace locations,
...
somecode
System.out.printf("trace: %d %d %d\n, x,y,z);
some more code
...
But I am not sure how I would "mark" the locations so that ASM can see
them. I cannot use comments as above, e.g., //@trace, because they are not
kept in the bytecode. I am thinking about using annotation but not sure how
that would work. A potential solution is actually introducing some trace
method and instead of @trace I would call trace(x,y,z); But I want to
avoid this.
Any suggestions ?
Thanks,
--
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws