instrumentation

proguard gradle debug build but not the tests

眉间皱痕 提交于 2019-12-17 15:58:08
问题 I enabled proguard for the debug build using: android { buildTypes { debug { runProguard true proguardFile 'proguard-debug.txt' } release { runProguard true proguardFile 'proguard-project.txt' zipAlign true } } } The problem I'm experiencing when I do this is that the gradle build wants to proguard the tests during the proguardDebugTest task as well. I can't seem to modify to get access to this particular task. Is there a way I can proguard the debug apk but not the test apk? 回答1: Put gradle

Avoiding variable slot collisions with ASM's LocalVariablesSorter

我与影子孤独终老i 提交于 2019-12-14 02:29:24
问题 I'm having a hard time seeing how LocalVariablesSorter from ASM is able to keep variable slot collisions from happening. A variable might come from the original source, or I might create a variable with LocalVariablesSorter.newLocal(Type t). Later on, visitVarInsn aise going to come in for those slots. Both from the original code, and from my injected code. How could LocalVariablesSorter tell them apart. They will both have the same slot index, how does it move one to the proper slot? I don't

How to find an empty local variable in a method for instrumenting using asm library

喜夏-厌秋 提交于 2019-12-13 15:28:54
问题 While instrumenting a class for its different methods In order to make a method do a write operation in a text file. I first stored the string in a local variable 3160 explicitly defined. How to choose these variables to prevent conflicts with already existing variables. Like in this snippet The code does the work of writing the class name to a text file every time it enters any method. In order to do so the string s had to be loaded on stack using variable 3160 ( value kept large so that the

Rational Test Workbench iPhone - could not merge original binaries could not merge instrumented binaries

风流意气都作罢 提交于 2019-12-13 04:35:34
问题 Below given are environment specification of my system System: MacBook Pro OS X version: 10.8.5 Worklight: 6.1 Emulator: 6.1 Build for iOS: 6.1 I have installed Mobile Test Workbench 8.5.1.2 in eclipse-kepler I followed instruction on the page at URL: https://pic.dhe.ibm.com/infocenter/rtwhelp/v8r5m0/index.jsp?topic=%2Fcom.ibm.rational.test.lt.moeb.doc%2Ftopics%2Frvar_select_device.html but when I try to instrument and install iPhone app for simulator some error occurs every time. Here I have

Using Class.forName() in Java Instrumentation Agent

一笑奈何 提交于 2019-12-13 03:58:16
问题 What I understand is that if I use: Instrumentation#getAllLoadedClasses() I do get a selection of all loaded classes by the target JVM. But If I do: Class.forName("my.class.name") This will not be the same class as the class loaded by VM. Yes, I can add this particular class as a jar in the agent MANIFEST.MF Class-Path - but that does not look the same to me as getAllLoadedClasses() . Could someone please confirm whether this is correct i.e. I would not be able to find a specific class using

Run Eclipse RCP application with Java instrumentation

删除回忆录丶 提交于 2019-12-13 01:23:54
问题 Using Java instrumentation, we can access a class that is loaded by the Java classloader from the JVM and modify its bytecode by inserting our custom code, all these done at runtime. We need not worry about security, these are governed by the same security context applicable for Java classes and respective classloaders. We are able to access some java application using this as they run in same classloader. Now what we are trying to do is to access eclipse RCP application using java

LLVM “Instruction does not dominate all uses” - Inserting new Instruction

元气小坏坏 提交于 2019-12-12 20:09:31
问题 I am getting the following error while inserting an instruction using an llvm pass: Instruction does not dominate all uses! %add = add nsw i32 10, 2 %cmp3 = icmp ne i32 %a.01, %add Broken module found, compilation aborted! I have the source code in a bitcode file whose snippet is: if.then: ; preds = %entry %add = add nsw i32 10, 2 br label %if.end if.else: ; preds = %entry %sub = sub nsw i32 10, 2 br label %if.end if.end: ; preds = %if.else, %if.then %a.0 = phi i32 [ %add, %if.then ], [ %sub,

how to debug an internal error?

自古美人都是妖i 提交于 2019-12-12 19:30:39
问题 So I have a class Foo that should eventually adjust and reload classes. It has a method for that, too: private void redefineClass(String classname, byte[] bytecode) { ClassFileLocator cfl = ClassFileLocator.Simple.of(classname,bytecode); Class clazz; try{ clazz = Class.forName(classname); }catch(ClassNotFoundException e){ throw new RuntimeException(e); } Debug._print("REDEFINING %s",clazz.getName()); new ByteBuddy() .redefine(clazz,cfl) .make() .load(clazz.getClassLoader(),

Force memory allocation always to the same virtual address [duplicate]

两盒软妹~` 提交于 2019-12-12 17:25:57
问题 This question already has answers here : disable the randomness in malloc (6 answers) Closed 5 years ago . I'm experimenting with Pin, an instrumentation tool, which I use to compute some statistics based on memory address of my variables. I want to re-run my program with the information gathered by my instrumentation tool, but for that it's crucial that virtual memory addresses remain the same through different runs. In general, I should let the OS handle memory allocation, but in this case

ActivityInstrumentationTestCase2 issues - test hangs because of invalidate() call in the code I'm writing a test for

て烟熏妆下的殇ゞ 提交于 2019-12-12 14:08:59
问题 I'm implementing a test for some code I've written which I have distilled down into a sample project pasted below. The problem I am having is that the test hangs the test runner and none of the test in my test case run. I have tracked the problem down to a call to invalidate() in getChildStaticTransformation(View child, Transformation t) which I am overriding to do some scaling effects. If I comment out the call to invalidate() then the tests run. The reason I'm calling invalidate() is to