Example #1
0
 public Object exe(Object... args) {
   JUtils.LOG("-------");
   for (Object arg : args) {
     JUtils.LOG("arg=" + arg);
   }
   JUtils.LOG("method=" + method);
   try {
     return this.method.invoke(null, args);
   } catch (InvocationTargetException e) {
     e.printStackTrace();
     throw new UnsupportedOperationException(toString());
   } catch (IllegalArgumentException e) {
     e.printStackTrace();
     throw new UnsupportedOperationException(toString());
   } catch (IllegalAccessException e) {
     e.printStackTrace();
     throw new UnsupportedOperationException(toString());
   }
 }
Example #2
0
 private CFunctionImpl(Class codingClass, String name) {
   this.codingClass = codingClass;
   this.name = name;
   for (Method m : codingClass.getMethods()) {
     if (m.getName().equals(name)) {
       this.method = m;
       return;
     }
   }
   JUtils.LOG("CANNOT FIND METHOD " + name + " IN " + codingClass);
   throw new IllegalStateException("codingClass=" + codingClass + " name=" + name);
 }
Example #3
0
 public __ptr__ addVirtualBytes(int bytes) {
   JUtils.LOG("CString::addVirtualBytes " + bytes);
   JUtils.LOG("AM " + this);
   if (bytes < 0) {
     OFFSET offset = OFFSET.fromInt(-bytes);
     JUtils.LOG("offset=" + offset);
     for (__ptr__ f : fathers) {
       JUtils.LOG("f=" + f);
       if (f instanceof StarStruct && ((StarStruct) f).getRealClass() == offset.getTheClass()) {
         JUtils.LOG("FOUND1!!");
         if (f.getPtr(offset.getField()).equals(this)) {
           JUtils.LOG("FOUND2!!");
           return f;
         }
       }
     }
   } else {
     JUtils.LOG("father=" + fathers);
     JUtils.LOG("CString created on the following place:");
     creation.printStackTrace();
   }
   throw new UnsupportedOperationException();
 }
Example #4
0
 public void setMyFather(__ptr__ struct) {
   if (this.toString().equals("black(0)")) {
     JUtils.LOG("CString::setMyFather " + this + "  " + fathers.size());
   }
   this.fathers.add(struct);
 }