Пример #1
0
    public boolean matches(Method method) {
      if (!symbol.contains(getMethodName(method))) {
        return false;
      }

      // if (!Modifier.isStatic(method.getModifiers()) &&
      // !symbol.contains(method.getDeclaringClass().getSimpleName()))
      //	return false;

      parse();

      try {
        if (ref != null) {
          boolean res = ref.matches(method);
          if (!res && BridJ.debug) {
            BridJ.debug(
                "Symbol "
                    + symbol
                    + " was a good candidate but expected demangled signature "
                    + ref
                    + " did not match the method "
                    + method);
          }
          return res;
        }
      } catch (Exception ex) {
        ex.printStackTrace();
      }
      return false;
    }
Пример #2
0
    public boolean matchesDestructor(Class<?> type) {
      if (!symbol.contains(type.getSimpleName())) {
        return false;
      }

      parse();

      try {
        if (ref != null) {
          return ref.matchesDestructor(type);
        }
      } catch (Exception ex) {
        ex.printStackTrace();
      }
      return false;
    }
Пример #3
0
    public boolean matchesConstructor(Type type, java.lang.reflect.Constructor<?> constr) {
      if (!symbol.contains(Utils.getClass(type).getSimpleName())) {
        return false;
      }

      parse();

      try {
        if (ref != null) {
          return ref.matchesConstructor(type, constr);
        }
      } catch (Exception ex) {
        ex.printStackTrace();
      }
      return false;
    }
Пример #4
0
 public static void main(String[] args) {
   //        try {
   ////            String s = "[email protected]@[email protected]@[email protected]@Z";
   //            String s = "[email protected]@[email protected]"; // "byte* f(byte*, short*, short*)"
   //            //String s = "[email protected]@@[email protected]";
   //            MemberRef mr = new VC9Demangler(null, s).parseSymbol();
   //            System.out.println(mr);
   //        } catch (DemanglingException ex) {
   //            Logger.getLogger(Demangler.class.getName()).error(null, ex);
   //        }
   for (String arg : args) {
     try {
       System.out.println("VC9: " + new VC9Demangler(null, arg).parseSymbol());
     } catch (Exception ex) {
       ex.printStackTrace();
     }
     try {
       System.out.println("GCC4: " + new GCC4Demangler(null, arg).parseSymbol());
     } catch (Exception ex) {
       ex.printStackTrace();
     }
   }
 }