当前位置: 首页>>代码示例>>Java>>正文


Java SourcePosition.getLine方法代码示例

本文整理汇总了Java中com.android.dx.rop.code.SourcePosition.getLine方法的典型用法代码示例。如果您正苦于以下问题:Java SourcePosition.getLine方法的具体用法?Java SourcePosition.getLine怎么用?Java SourcePosition.getLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.android.dx.rop.code.SourcePosition的用法示例。


在下文中一共展示了SourcePosition.getLine方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateReturnOp

import com.android.dx.rop.code.SourcePosition; //导入方法依赖的package包/类
/**
 * Sets or updates the information about the return block.
 *
 * @param op {@code non-null;} the opcode to use
 * @param pos {@code non-null;} the position to use
 */
private void updateReturnOp(Rop op, SourcePosition pos) {
    if (op == null) {
        throw new NullPointerException("op == null");
    }

    if (pos == null) {
        throw new NullPointerException("pos == null");
    }

    if (returnOp == null) {
        returnOp = op;
        returnPosition = pos;
    } else {
        if (returnOp != op) {
            throw new SimException("return op mismatch: " + op + ", " +
                                   returnOp);
        }

        if (pos.getLine() > returnPosition.getLine()) {
            // Pick the largest line number to be the "canonical" return.
            returnPosition = pos;
        }
    }
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:31,代码来源:RopperMachine.java

示例2: updateInfo

import com.android.dx.rop.code.SourcePosition; //导入方法依赖的package包/类
/**
 * Helper for {@link #add} and {@link #insert},
 * which updates the position and local info flags.
 *
 * @param insn {@code non-null;} an instruction that was just introduced
 */
private void updateInfo(DalvInsn insn) {
    if (! hasAnyPositionInfo) {
        SourcePosition pos = insn.getPosition();
        if (pos.getLine() >= 0) {
            hasAnyPositionInfo = true;
        }
    }

    if (! hasAnyLocalInfo) {
        if (hasLocalInfo(insn)) {
            hasAnyLocalInfo = true;
        }
    }
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:21,代码来源:OutputFinisher.java

示例3: emitPosition

import com.android.dx.rop.code.SourcePosition; //导入方法依赖的package包/类
/**
 * Emits the necessary byte sequences to emit the given position table
 * entry. This will typically be a single special opcode, although
 * it may also require DBG_ADVANCE_PC or DBG_ADVANCE_LINE.
 *
 * @param entry position entry to emit.
 * @throws IOException
 */
private void emitPosition(PositionList.Entry entry)
        throws IOException {

    SourcePosition pos = entry.getPosition();
    int newLine = pos.getLine();
    int newAddress = entry.getAddress();

    int opcode;

    int deltaLines = newLine - line;
    int deltaAddress = newAddress - address;

    if (deltaAddress < 0) {
        throw new RuntimeException(
                "Position entries must be in ascending address order");
    }

    if ((deltaLines < DBG_LINE_BASE)
            || (deltaLines > (DBG_LINE_BASE + DBG_LINE_RANGE -1))) {
        emitAdvanceLine(deltaLines);
        deltaLines = 0;
    }

    opcode = computeOpcode (deltaLines, deltaAddress);

    if ((opcode & ~0xff) > 0) {
        emitAdvancePc(deltaAddress);
        deltaAddress = 0;
        opcode = computeOpcode (deltaLines, deltaAddress);

        if ((opcode & ~0xff) > 0) {
            emitAdvanceLine(deltaLines);
            deltaLines = 0;
            opcode = computeOpcode (deltaLines, deltaAddress);
        }
    }

    output.writeByte(opcode);

    line += deltaLines;
    address += deltaAddress;

    if (annotateTo != null || debugPrint != null) {
        annotate(1,
                String.format("%04x: line %d", address, line));
    }
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:56,代码来源:DebugInfoEncoder.java


注:本文中的com.android.dx.rop.code.SourcePosition.getLine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。