what's the content in method jacocoInit()

34 views
Skip to first unread message

moon xxx

unread,
Jul 21, 2020, 2:49:53 AM7/21/20
to JaCoCo and EclEmma Users
I am learning the jacoco code, I ran the class "CoreTutorial", and dump the bytecode, This's what I saw in the class file
boolean[] var1 = $jacocoInit(); 

How can I see the content in method "$jacocoInit()", meanwhile, I notice there is a variable named jacocoData, but I cannot saw it in the class file.

Marc Hoffmann

unread,
Jul 21, 2020, 3:41:06 AM7/21/20
to JaCoCo and EclEmma Users
Hi,

if you want to study byte code instrumentation done by JaCoCo I recommend to use offline instrumentation (e.g. with the cli) and decompile instrumented classes afterwards. The “CoreTutorial” instruments classes in-memory only.

Part of the content of $jacocoInit() depends on the selected runtime (See IExecutionDataAccessorGenerator implementations and https://www.jacoco.org/jacoco/trunk/doc/implementation.html)

Cheers,
-marc


--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/a75e3c51-89f0-4c0c-9313-de3b65daea1ao%40googlegroups.com.

moon xxx

unread,
Jul 31, 2020, 2:57:11 AM7/31/20
to JaCoCo and EclEmma Users
File file = new File("xxxx");
FileOutputStream f = new FileOutputStream(file);
f.write(instrumented);
f.close();

I add this in class CoreTutorial method execute(), write the instrumented classes to the file then decompile it. but cannot see what's in the method jacocoInit()

if you want to study byte code instrumentation done by JaCoCo I recommend to use offline instrumentation (e.g. with the cli) and decompile instrumented classes afterwards. The “CoreTutorial” instruments classes in-memory only.

Part of the content of $jacocoInit() depends on the selected runtime (See IExecutionDataAccessorGenerator implementations and https://www.jacoco.org/jacoco/trunk/doc/implementation.html)

Cheers,
-marc


On 21. Jul 2020, at 08:49, moon xxx <qiaom...@gmail.com> wrote:

I am learning the jacoco code, I ran the class "CoreTutorial", and dump the bytecode, This's what I saw in the class file
boolean[] var1 = $jacocoInit(); 

How can I see the content in method "$jacocoInit()", meanwhile, I notice there is a variable named jacocoData, but I cannot saw it in the class file.

--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jac...@googlegroups.com.

Marc Hoffmann

unread,
Jul 31, 2020, 4:38:03 AM7/31/20
to jac...@googlegroups.com
Are you using javap to decompile? In this case specify options -v -c otherwise you won’t see code.


To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/4153cb66-95b9-497c-8175-7e2b199d0094o%40googlegroups.com.

moon xxx

unread,
Aug 7, 2020, 3:19:38 AM8/7/20
to JaCoCo and EclEmma Users
thank you
Reply all
Reply to author
Forward
0 new messages