Re: Instrument at marked locations

Jochen Theodorou <[email protected]> Thu, 30 Nov 2017 13:20:08 +0100
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <[email protected]>

Am 30.11.2017 um 00:03 schrieb ThanhVu (Vu) Nguyen:
> 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.  

What I did in the past was to push a String constant and then pop it 
again. I used this mainly to mark certain parts in the bytecode to know 
what part of my compiler produced them. But I am not sure if ASM will 
eliminate this kind of code now.

bye Jochen


-- 
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