/** * Line Tag Adder */ public static void addLineTag(soot.tagkit.Host host, int sLine, int eLine) { host.addTag(new soot.tagkit.SourceLineNumberTag(sLine, eLine)); }
public static void addMethodLineTag(soot.tagkit.Host host, int sline, int eline) { if (soot.options.Options.v().keep_line_number()) { host.addTag(new soot.tagkit.SourceLineNumberTag(sline, eline)); } }
/** * Fixes the line numbers. If there is a unit without a line number, it gets the line number of the last (transitive) * predecessor that has a line number. */ protected void fixLineNumbers() { int prevLn = -1; for (DexlibAbstractInstruction instruction : instructions) { Unit unit = instruction.getUnit(); int lineNumber = unit.getJavaSourceStartLineNumber(); if (lineNumber < 0) { if (prevLn >= 0) { unit.addTag(new LineNumberTag(prevLn)); unit.addTag(new SourceLineNumberTag(prevLn)); } } else { prevLn = lineNumber; } } }
/** * Line Tag Adder */ public static void addLineTag(soot.tagkit.Host host, polyglot.ast.Node node) { if (soot.options.Options.v().keep_line_number()) { if (node.position() != null) { host.addTag(new soot.tagkit.SourceLineNumberTag(node.position().line(), node.position().line())); } } }
/** * Tag the passed host with: - this instructions line number (if one is set) - the original bytecode offset * * @param host * the host to tag */ protected void addTags(Host host) { Options options = Options.v(); if (options.keep_line_number() && lineNumber != -1) { host.addTag(new LineNumberTag(lineNumber)); host.addTag(new SourceLineNumberTag(lineNumber)); } if (options.keep_offset()) { host.addTag(new BytecodeOffsetTag(codeAddress)); } }