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


Java MethodImplementation.getDebugItems方法代码示例

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


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

示例1: getSourceFileLine

import org.jf.dexlib2.iface.MethodImplementation; //导入方法依赖的package包/类
@Override
protected int getSourceFileLine() {
	// Parse debug information lazily.
	if (sourceFileMethod != null) {
		MethodImplementation mi = sourceFileMethod.getImplementation();
		if (mi != null) {
			for (DebugItem di : mi.getDebugItems()) {
				if (di instanceof LineNumber) {
					sourceFileLine = ((LineNumber) di).getLineNumber();
					break;
				}
				if (di instanceof SetSourceFile) {
					// TODO: Support this type of debug item.
					break;
				}
			}
		}
		sourceFileMethod = null;
	}
	return sourceFileLine;
}
 
开发者ID:DexPatcher,项目名称:dexpatcher-tool,代码行数:22,代码来源:MethodSetPatcher.java

示例2: internDebug

import org.jf.dexlib2.iface.MethodImplementation; //导入方法依赖的package包/类
private void internDebug(@Nonnull Method method) {
    for (MethodParameter param : method.getParameters()) {
        String paramName = param.getName();
        if (paramName != null) {
            stringPool.intern(paramName);
        }
    }

    MethodImplementation methodImpl = method.getImplementation();
    if (methodImpl != null) {
        for (DebugItem debugItem : methodImpl.getDebugItems()) {
            switch (debugItem.getDebugItemType()) {
                case DebugItemType.START_LOCAL:
                    StartLocal startLocal = (StartLocal) debugItem;
                    stringPool.internNullable(startLocal.getName());
                    typePool.internNullable(startLocal.getType());
                    stringPool.internNullable(startLocal.getSignature());
                    break;
                case DebugItemType.SET_SOURCE_FILE:
                    stringPool.internNullable(((SetSourceFile) debugItem).getSourceFile());
                    break;
            }
        }
    }
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:26,代码来源:ClassPool.java

示例3: reMethodImpl

import org.jf.dexlib2.iface.MethodImplementation; //导入方法依赖的package包/类
@Override
protected MethodImplementation reMethodImpl(MethodImplementation methodImplementation) {
    if (methodImplementation == null){
        return null;
    }
    Iterable<? extends Instruction> instructions = methodImplementation.getInstructions();
    Iterable<? extends DebugItem> debugItems = methodImplementation.getDebugItems();
    List<? extends TryBlock<? extends ExceptionHandler>> tryBlocks = methodImplementation.getTryBlocks();
    return new ImmutableMethodImplementation(methodImplementation.getRegisterCount(), reInstructions(instructions), reTryCatchBlock(methodImplementation.getTryBlocks()), reDebugItem(methodImplementation.getDebugItems()));

}
 
开发者ID:alibaba,项目名称:atlas,代码行数:12,代码来源:MethodImplReIClassDef.java

示例4: of

import org.jf.dexlib2.iface.MethodImplementation; //导入方法依赖的package包/类
@Nullable
public static ImmutableMethodImplementation of(@Nullable MethodImplementation methodImplementation) {
    if (methodImplementation == null) {
        return null;
    }
    if (methodImplementation instanceof ImmutableMethodImplementation) {
        return (ImmutableMethodImplementation)methodImplementation;
    }
    return new ImmutableMethodImplementation(
            methodImplementation.getRegisterCount(),
            methodImplementation.getInstructions(),
            methodImplementation.getTryBlocks(),
            methodImplementation.getDebugItems());
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:15,代码来源:ImmutableMethodImplementation.java

示例5: getDebugItems

import org.jf.dexlib2.iface.MethodImplementation; //导入方法依赖的package包/类
@Nullable @Override
public Iterable<? extends DebugItem> getDebugItems(@Nonnull BuilderMethod builderMethod) {
    MethodImplementation impl = builderMethod.getImplementation();
    if (impl == null) {
        return null;
    }
    return impl.getDebugItems();
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:9,代码来源:BuilderClassPool.java

示例6: of

import org.jf.dexlib2.iface.MethodImplementation; //导入方法依赖的package包/类
public static ImmutableMethodImplementation of( MethodImplementation methodImplementation) {
    if (methodImplementation == null) {
        return null;
    }
    if (methodImplementation instanceof ImmutableMethodImplementation) {
        return (ImmutableMethodImplementation)methodImplementation;
    }
    return new ImmutableMethodImplementation(
            methodImplementation.getRegisterCount(),
            methodImplementation.getInstructions(),
            methodImplementation.getTryBlocks(),
            methodImplementation.getDebugItems());
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:14,代码来源:ImmutableMethodImplementation.java

示例7: getDebugItems

import org.jf.dexlib2.iface.MethodImplementation; //导入方法依赖的package包/类
@Override
public Iterable<? extends DebugItem> getDebugItems( BuilderMethod builderMethod) {
    MethodImplementation impl = builderMethod.getImplementation();
    if (impl == null) {
        return null;
    }
    return impl.getDebugItems();
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:9,代码来源:BuilderClassPool.java

示例8: onSimpleEdit

import org.jf.dexlib2.iface.MethodImplementation; //导入方法依赖的package包/类
@Override
protected Method onSimpleEdit(Method patch, PatcherAnnotation annotation, Method target, boolean inPlace) {

	if (!inPlace && NATIVE.isSet(patch.getAccessFlags() & target.getAccessFlags())) {
		log(ERROR, "cannot rename native method");
	}

	MethodImplementation implementation = target.getImplementation();
	if (isTaggedByLastParameter(patch, false)) {
		List<? extends MethodParameter> parameters = patch.getParameters();
		MethodParameter lastParameter = parameters.get(parameters.size() - 1);
		int tagRegisterCount = (TypeUtils.isWideType(lastParameter) ? 2 : 1);
		implementation = new BasicMethodImplementation(
				implementation.getRegisterCount() + tagRegisterCount,
				implementation.getInstructions(),
				implementation.getTryBlocks(),
				implementation.getDebugItems());
	}

	Method patched = new BasicMethod(
			patch.getDefiningClass(),
			patch.getName(),
			patch.getParameters(),
			patch.getReturnType(),
			patch.getAccessFlags(),
			annotation.getFilteredAnnotations(),
			implementation);

	return super.onSimpleEdit(patched, annotation, target, inPlace);

}
 
开发者ID:DexPatcher,项目名称:dexpatcher-tool,代码行数:32,代码来源:MethodSetPatcher.java

示例9: of

import org.jf.dexlib2.iface.MethodImplementation; //导入方法依赖的package包/类
@Nullable
public static ImmutableMethodImplementation of(@Nullable MethodImplementation methodImplementation) {
    if (methodImplementation == null) {
        return null;
    }
    if (methodImplementation instanceof ImmutableMethodImplementation) {
        return (ImmutableMethodImplementation) methodImplementation;
    }
    return new ImmutableMethodImplementation(
            methodImplementation.getRegisterCount(),
            methodImplementation.getInstructions(),
            methodImplementation.getTryBlocks(),
            methodImplementation.getDebugItems());
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:15,代码来源:ImmutableMethodImplementation.java

示例10: getDebugItems

import org.jf.dexlib2.iface.MethodImplementation; //导入方法依赖的package包/类
@Nullable
@Override
public Iterable<? extends DebugItem> getDebugItems(@Nonnull PoolMethod method) {
    MethodImplementation impl = method.getImplementation();
    if (impl != null) {
        return impl.getDebugItems();
    }
    return null;
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:10,代码来源:ClassPool.java

示例11: getDebugItems

import org.jf.dexlib2.iface.MethodImplementation; //导入方法依赖的package包/类
@Nullable
@Override
public Iterable<? extends DebugItem> getDebugItems(@Nonnull BuilderMethod builderMethod) {
    MethodImplementation impl = builderMethod.getImplementation();
    if (impl == null) {
        return null;
    }
    return impl.getDebugItems();
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:10,代码来源:BuilderClassPool.java

示例12: DexBody

import org.jf.dexlib2.iface.MethodImplementation; //导入方法依赖的package包/类
/**
 * @param code the codeitem that is contained in this body
 * @param method the method that is associated with this body
 */
public DexBody(DexFile dexFile, Method method, RefType declaringClassType) {
    MethodImplementation code = method.getImplementation();
    if (code == null)
        throw new RuntimeException("error: no code for method "+ method.getName());
    this.declaringClassType = declaringClassType;
    tries = code.getTryBlocks();
    methodSignature = method.getDefiningClass() +": "+ method.getReturnType() +" "+ method.getName() +"(";
    for (MethodParameter mp: method.getParameters())
        methodSignature += mp.getType() +",";

    List<? extends CharSequence> paramTypes = method.getParameterTypes();
    if (paramTypes != null) {
        parameterTypes = new ArrayList<Type>();
        for (CharSequence type : paramTypes)
            parameterTypes.add(DexType.toSoot(type.toString()));
    } else {
    	parameterTypes = Collections.emptyList();
    }
    
    isStatic = Modifier.isStatic(method.getAccessFlags());
    numRegisters = code.getRegisterCount();
    numParameterRegisters = MethodUtil.getParameterRegisterCount(method);
    if (!isStatic)
        numParameterRegisters--;

    instructions = new ArrayList<DexlibAbstractInstruction>();
    instructionAtAddress = new HashMap<Integer, DexlibAbstractInstruction>();

    registerLocals = new Local[numRegisters];

    int address = 0;
    
    for (Instruction instruction : code.getInstructions()) {
        DexlibAbstractInstruction dexInstruction = fromInstruction(instruction, address);
        instructions.add(dexInstruction);
        instructionAtAddress.put(address, dexInstruction);
        Debug.printDbg(" put instruction '", dexInstruction ,"' at 0x", Integer.toHexString(address));
        address += instruction.getCodeUnits();
    }
    
    // Check taken from Android's dalvik/libdex/DexSwapVerify.cpp
    if (numParameterRegisters > numRegisters)
    	throw new RuntimeException("Malformed dex file: insSize (" + numParameterRegisters
    			+ ") > registersSize (" + numRegisters + ")");
    
    for (DebugItem di: code.getDebugItems()) {
        if (di instanceof ImmutableLineNumber) {
            ImmutableLineNumber ln = (ImmutableLineNumber)di;
            DexlibAbstractInstruction ins = instructionAtAddress(ln.getCodeAddress());
            if (ins == null) {
            	Debug.printDbg("Line number tag pointing to invalid offset: " + ln.getCodeAddress());
            	continue;
            }
            ins.setLineNumber(ln.getLineNumber());
            Debug.printDbg("Add line number tag " + ln.getLineNumber() + " for instruction: "
                    + instructionAtAddress(ln.getCodeAddress()));
        }
    }

    this.dexFile = dexFile;
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:66,代码来源:DexBody.java


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