[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: soot createclass tutorial



Yes, that was the problem.  I though it was there, but it wasn't.  Thanks, Chris.

Eric Bodden wrote:
Hi!

Is the runtime library included in the SootClassPath? The easiest way to
do that is to include "rt.jar" in your JRE lib folder.

Cheers,
Eric

------------------------------------------------------------
Eric Bodden
CS-DIP full time student @ University of Kent at Canterbury
UKC internal phone: 5095
ICQ UIN: 12656220, secure mail on demand
Website: http://www.bodden.de

  
-----Original Message-----
From: owner-soot-list@sable.mcgill.ca 
[mailto:owner-soot-list@sable.mcgill.ca] On Behalf Of Chris Pickett
Sent: 11 February 2003 4:44 AM
To: soot-list@sable.mcgill.ca
Subject: soot createclass tutorial


Hi,

I'm trying to do the first lesson in the second half of the soot 
tutorial.  I can get CreateClassExample.java to compile with 
Sun's SDK 
1.4.1, but I can't get CreateClassExample.class to execute without 
throwing the following exception:

Exception in thread "main" java.lang.RuntimeException: tried to get 
nonexistent field!
        at soot.Scene.getField(Scene.java:329)
        at CreateClassExample.main(CreateClassExample.java:98)

In CreateClassExample:

// add "tmpRef = java.lang.System.out"
units.add(
  Jimple.v().newAssignStmt(
    tmpRef, Jimple.v().newStaticFieldRef(
      Scene.v().getField(
        "<java.lang.System: java.io.PrintStream out>"))));

In Scene.java:
 
public SootField getField(String fieldSignature)
    {
        SootField f = (SootField) 
fieldSignatureToField.get(fieldSignature);
        if (f != null)
            return f;

        throw new RuntimeException("tried to get nonexistent field!");
    }

Also, in the tutorial, r0 and r1 in the sample Jimple output 
need to be 
updated to l0 and tmpRef respectively.

Cheers,
Chris