From: <fra...@us...> - 2009-04-20 16:57:24
|
Revision: 1421 http://javapathfinder.svn.sourceforge.net/javapathfinder/?rev=1421&view=rev Author: frankrimlinger Date: 2009-04-20 16:57:17 +0000 (Mon, 20 Apr 2009) Log Message: ----------- Brilliant idea to reflect the target method inside target launcher main() for jpf symbolic execution has ended in abject failure: java.lang.ClassNotFoundException at java.lang.Class.forName(Native Method) at mango.symbc.MangoTargetLauncher.getTargetMethod(MangoTargetLauncher.java:37) at mango.symbc.MangoTargetLauncher.main(MangoTargetLauncher.java:13) Evidently jpf draws the line at diving into reflection, and who can blame it for that? Also, any hanky panky with the entrypoint is ruled out: on page 158, section5.2 of JVM2nd Ed., we have "The Java virtual machine then links the initial class, initializes it, and invokes its public class method void main(String[]). So it is written, so it must be. This is one of those exquisitely rare occasions when direct alteration of the .class file is required. Therefore, prior to any class loading, I will use my home-grown parser to read in MangoTargetLauncher.class, burn in the call to the targeted method, and write it back out. The trick is just to make sure that no other ClassLoader can find MangoTargetLauncher, and then call the "midnight special" ClassLoader to load it in when it is ready to go. Modified Paths: -------------- branches/mango/MangoJPF/Mango/src/mango/worker/javaModel/classParser/ClassParsingAlg.java branches/mango/MangoJPF/Mango/src/mango/workstation/Workstation.java Added Paths: ----------- branches/mango/MangoJPF/javapathfinder-trunk-MIRROR/mango/symbc/MangoTargetLauncher.java This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |