/** * Does a human-friendly dump of this instance. * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} prefix to attach to each line of output * @param verbose whether to be verbose; verbose output includes * lines for zero-size instructions */ public void debugPrint(OutputStream out, String prefix, boolean verbose) { Writer w = new OutputStreamWriter(out); debugPrint(w, prefix, verbose); try { w.flush(); } catch (IOException ex) { throw new RuntimeException(ex); } } }
/** * Does a human-friendly dump of this instance. * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} prefix to attach to each line of output * @param verbose whether to be verbose; verbose output includes * lines for zero-size instructions */ public void debugPrint(OutputStream out, String prefix, boolean verbose) { Writer w = new OutputStreamWriter(out); debugPrint(w, prefix, verbose); try { w.flush(); } catch (IOException ex) { throw new RuntimeException(ex); } } }
/** * Does a human-friendly dump of this instance. * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} prefix to attach to each line of output * @param verbose whether to be verbose; verbose output includes * lines for zero-size instructions */ public void debugPrint(OutputStream out, String prefix, boolean verbose) { Writer w = new OutputStreamWriter(out); debugPrint(w, prefix, verbose); try { w.flush(); } catch (IOException ex) { throw new RuntimeException(ex); } } }
/** * Does a human-friendly dump of this instance. * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} prefix to attach to each line of output * @param verbose whether to be verbose; verbose output includes * lines for zero-size instructions */ public void debugPrint(OutputStream out, String prefix, boolean verbose) { Writer w = new OutputStreamWriter(out); debugPrint(w, prefix, verbose); try { w.flush(); } catch (IOException ex) { throw new RuntimeException(ex); } } }
/** * Does a human-friendly dump of this instance. * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} prefix to attach to each line of output * @param verbose whether to be verbose; verbose output includes * lines for zero-size instructions */ public void debugPrint(OutputStream out, String prefix, boolean verbose) { Writer w = new OutputStreamWriter(out); debugPrint(w, prefix, verbose); try { w.flush(); } catch (IOException ex) { throw new RuntimeException(ex); } } }
/** * Does a human-friendly dump of this instance. * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} prefix to attach to each line of output * @param verbose whether to be verbose; verbose output includes * lines for zero-size instructions */ public void debugPrint(OutputStream out, String prefix, boolean verbose) { Writer w = new OutputStreamWriter(out); debugPrint(w, prefix, verbose); try { w.flush(); } catch (IOException ex) { throw new RuntimeException(ex); } } }
/** * Does a human-friendly dump of this instance. * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} prefix to attach to each line of output * @param verbose whether to be verbose; verbose output includes * lines for zero-size instructions */ public void debugPrint(OutputStream out, String prefix, boolean verbose) { Writer w = new OutputStreamWriter(out); debugPrint(w, prefix, verbose); try { w.flush(); } catch (IOException ex) { throw new RuntimeException(ex); } } }
/** * Does a human-friendly dump of this instance. * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} prefix to attach to each line of output * @param verbose whether to be verbose; verbose output includes * lines for zero-size instructions */ public void debugPrint(OutputStream out, String prefix, boolean verbose) { Writer w = new OutputStreamWriter(out); debugPrint(w, prefix, verbose); try { w.flush(); } catch (IOException ex) { throw new RuntimeException(ex); } } }
/** * Does a human-friendly dump of this instance. * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} per-line prefix to use * @param verbose whether to be verbose with the output */ public void debugPrint(PrintWriter out, String prefix, boolean verbose) { out.println(ref.toHuman() + ":"); DalvInsnList insns = code.getInsns(); out.println("regs: " + Hex.u2(getRegistersSize()) + "; ins: " + Hex.u2(getInsSize()) + "; outs: " + Hex.u2(getOutsSize())); insns.debugPrint(out, prefix, verbose); String prefix2 = prefix + " "; if (catches != null) { out.print(prefix); out.println("catches"); catches.debugPrint(out, prefix2); } if (debugInfo != null) { out.print(prefix); out.println("debug info"); debugInfo.debugPrint(out, prefix2); } }
/** * Does a human-friendly dump of this instance. * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} per-line prefix to use * @param verbose whether to be verbose with the output */ public void debugPrint(PrintWriter out, String prefix, boolean verbose) { out.println(ref.toHuman() + ":"); DalvInsnList insns = code.getInsns(); out.println("regs: " + Hex.u2(getRegistersSize()) + "; ins: " + Hex.u2(getInsSize()) + "; outs: " + Hex.u2(getOutsSize())); insns.debugPrint(out, prefix, verbose); String prefix2 = prefix + " "; if (catches != null) { out.print(prefix); out.println("catches"); catches.debugPrint(out, prefix2); } if (debugInfo != null) { out.print(prefix); out.println("debug info"); debugInfo.debugPrint(out, prefix2); } }
/** * Does a human-friendly dump of this instance. * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} per-line prefix to use * @param verbose whether to be verbose with the output */ public void debugPrint(PrintWriter out, String prefix, boolean verbose) { out.println(ref.toHuman() + ":"); DalvInsnList insns = code.getInsns(); out.println("regs: " + Hex.u2(getRegistersSize()) + "; ins: " + Hex.u2(getInsSize()) + "; outs: " + Hex.u2(getOutsSize())); insns.debugPrint(out, prefix, verbose); String prefix2 = prefix + " "; if (catches != null) { out.print(prefix); out.println("catches"); catches.debugPrint(out, prefix2); } if (debugInfo != null) { out.print(prefix); out.println("debug info"); debugInfo.debugPrint(out, prefix2); } }
/** * Does a human-friendly dump of this instance. * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} per-line prefix to use * @param verbose whether to be verbose with the output */ public void debugPrint(PrintWriter out, String prefix, boolean verbose) { out.println(ref.toHuman() + ":"); DalvInsnList insns = code.getInsns(); out.println("regs: " + Hex.u2(getRegistersSize()) + "; ins: " + Hex.u2(getInsSize()) + "; outs: " + Hex.u2(getOutsSize())); insns.debugPrint(out, prefix, verbose); String prefix2 = prefix + " "; if (catches != null) { out.print(prefix); out.println("catches"); catches.debugPrint(out, prefix2); } if (debugInfo != null) { out.print(prefix); out.println("debug info"); debugInfo.debugPrint(out, prefix2); } }
/** * Does a human-friendly dump of this instance. * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} per-line prefix to use * @param verbose whether to be verbose with the output */ public void debugPrint(PrintWriter out, String prefix, boolean verbose) { out.println(ref.toHuman() + ":"); DalvInsnList insns = code.getInsns(); out.println("regs: " + Hex.u2(getRegistersSize()) + "; ins: " + Hex.u2(getInsSize()) + "; outs: " + Hex.u2(getOutsSize())); insns.debugPrint(out, prefix, verbose); String prefix2 = prefix + " "; if (catches != null) { out.print(prefix); out.println("catches"); catches.debugPrint(out, prefix2); } if (debugInfo != null) { out.print(prefix); out.println("debug info"); debugInfo.debugPrint(out, prefix2); } }
/** * Does a human-friendly dump of this instance. * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} per-line prefix to use * @param verbose whether to be verbose with the output */ public void debugPrint(PrintWriter out, String prefix, boolean verbose) { out.println(ref.toHuman() + ":"); DalvInsnList insns = code.getInsns(); out.println("regs: " + Hex.u2(getRegistersSize()) + "; ins: " + Hex.u2(getInsSize()) + "; outs: " + Hex.u2(getOutsSize())); insns.debugPrint(out, prefix, verbose); String prefix2 = prefix + " "; if (catches != null) { out.print(prefix); out.println("catches"); catches.debugPrint(out, prefix2); } if (debugInfo != null) { out.print(prefix); out.println("debug info"); debugInfo.debugPrint(out, prefix2); } }
/** * Does a human-friendly dump of this instance. * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} per-line prefix to use * @param verbose whether to be verbose with the output */ public void debugPrint(PrintWriter out, String prefix, boolean verbose) { out.println(ref.toHuman() + ":"); DalvInsnList insns = code.getInsns(); out.println("regs: " + Hex.u2(getRegistersSize()) + "; ins: " + Hex.u2(getInsSize()) + "; outs: " + Hex.u2(getOutsSize())); insns.debugPrint(out, prefix, verbose); String prefix2 = prefix + " "; if (catches != null) { out.print(prefix); out.println("catches"); catches.debugPrint(out, prefix2); } if (debugInfo != null) { out.print(prefix); out.println("debug info"); debugInfo.debugPrint(out, prefix2); } }
/** * Does a human-friendly dump of this instance. * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} per-line prefix to use * @param verbose whether to be verbose with the output */ public void debugPrint(PrintWriter out, String prefix, boolean verbose) { out.println(ref.toHuman() + ":"); DalvInsnList insns = code.getInsns(); out.println("regs: " + Hex.u2(getRegistersSize()) + "; ins: " + Hex.u2(getInsSize()) + "; outs: " + Hex.u2(getOutsSize())); insns.debugPrint(out, prefix, verbose); String prefix2 = prefix + " "; if (catches != null) { out.print(prefix); out.println("catches"); catches.debugPrint(out, prefix2); } if (debugInfo != null) { out.print(prefix); out.println("debug info"); debugInfo.debugPrint(out, prefix2); } }
/** * Validates an encoded debug info stream against data used to encode it, * throwing an exception if they do not match. Used to validate the * encoder. * * @param info encoded debug info * @param file {@code non-null;} file to refer to during decoding * @param ref {@code non-null;} method whose info is being decoded * @param code {@code non-null;} original code object that was encoded * @param isStatic whether the method is static */ public static void validateEncode(byte[] info, DexFile file, CstMethodRef ref, DalvCode code, boolean isStatic) { PositionList pl = code.getPositions(); LocalList ll = code.getLocals(); DalvInsnList insns = code.getInsns(); int codeSize = insns.codeSize(); int countRegisters = insns.getRegistersSize(); try { validateEncode0(info, codeSize, countRegisters, isStatic, ref, file, pl, ll); } catch (RuntimeException ex) { System.err.println("instructions:"); insns.debugPrint(System.err, " ", true); System.err.println("local list:"); ll.debugPrint(System.err, " "); throw ExceptionWithContext.withContext(ex, "while processing " + ref.toHuman()); } }
} catch (RuntimeException ex) { System.err.println("instructions:"); insns.debugPrint(System.err, " ", true); System.err.println("local list:"); ll.debugPrint(System.err, " ");
/** * Validates an encoded debug info stream against data used to encode it, * throwing an exception if they do not match. Used to validate the * encoder. * * @param info encoded debug info * @param file {@code non-null;} file to refer to during decoding * @param ref {@code non-null;} method whose info is being decoded * @param code {@code non-null;} original code object that was encoded * @param isStatic whether the method is static */ public static void validateEncode(byte[] info, DexFile file, CstMethodRef ref, DalvCode code, boolean isStatic) { PositionList pl = code.getPositions(); LocalList ll = code.getLocals(); DalvInsnList insns = code.getInsns(); int codeSize = insns.codeSize(); int countRegisters = insns.getRegistersSize(); try { validateEncode0(info, codeSize, countRegisters, isStatic, ref, file, pl, ll); } catch (RuntimeException ex) { System.err.println("instructions:"); insns.debugPrint(System.err, " ", true); System.err.println("local list:"); ll.debugPrint(System.err, " "); throw ExceptionWithContext.withContext(ex, "while processing " + ref.toHuman()); } }
/** * Validates an encoded debug info stream against data used to encode it, * throwing an exception if they do not match. Used to validate the * encoder. * * @param info encoded debug info * @param file {@code non-null;} file to refer to during decoding * @param ref {@code non-null;} method whose info is being decoded * @param code {@code non-null;} original code object that was encoded * @param isStatic whether the method is static */ public static void validateEncode(byte[] info, DexFile file, CstMethodRef ref, DalvCode code, boolean isStatic) { PositionList pl = code.getPositions(); LocalList ll = code.getLocals(); DalvInsnList insns = code.getInsns(); int codeSize = insns.codeSize(); int countRegisters = insns.getRegistersSize(); try { validateEncode0(info, codeSize, countRegisters, isStatic, ref, file, pl, ll); } catch (RuntimeException ex) { System.err.println("instructions:"); insns.debugPrint(System.err, " ", true); System.err.println("local list:"); ll.debugPrint(System.err, " "); throw ExceptionWithContext.withContext(ex, "while processing " + ref.toHuman()); } }