Results 1 to 3 of 3
- 02-22-2012, 12:36 AM #1
Member
- Join Date
- Feb 2012
- Posts
- 1
- Rep Power
- 0
Best choice? Edit bytecode (asm) or edit java file before compiling
Goal
Detecting where comparisons between and copies of variables are made
Inject code near the line where the operation has happened
The purpose of the code: everytime the class is ran make a counter increase
General purpose: count the amount of comparisons and copies made after execution with certain parameters
2 options
Note: I always have a .java file to begin with
1) Edit java file
Find comparisons with regex and inject pieces of code near the line And then compile the class (My application uses JavaCompiler)
2)Use ASM Bytecode engineering
Also detecting where the events i want to track and inject pieces into the bytecode And then use the (already compiled but modified) class
My Question
What is the best/cleanest way? Is there a better way to do this?
- 02-22-2012, 02:33 AM #2
Re: Best choice? Edit bytecode (asm) or edit java file before compiling
Can you explain what you are trying to do?
And why changing the source and recompiling is a problem.
- 02-22-2012, 10:09 AM #3
Re: Best choice? Edit bytecode (asm) or edit java file before compiling
Why do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
Edit conf file
By bikashlama in forum New To JavaReplies: 1Last Post: 12-29-2011, 01:02 PM -
Delete and edit data in xml file using JSP
By gurpreet.singh in forum JavaServer Pages (JSP) and JSTLReplies: 6Last Post: 03-10-2011, 08:07 AM -
Read and edit text file
By VinTiger in forum New To JavaReplies: 5Last Post: 05-14-2009, 01:18 AM -
Manually edit volume of MIDI file in Java
By Ravaa in forum New To JavaReplies: 1Last Post: 03-04-2009, 05:57 PM -
How to edit/delete a line in *.dat file in java io and applets
By kalanidhi in forum New To JavaReplies: 1Last Post: 11-10-2008, 09:49 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks