Regarding gcov using arm-eabi toolchain

by Manish Sharma » Wed, 08 Dec 2010 16:28:03 GMT


Sponsored Links
 Dear All,

We have developed an application for which we would like to check the code
coverage.
We have used gcov available in android toolchain.

In our Android.mk file we have added the following LOCAL_FLAGS and included
the libgcov static library.

LOCAL_CFLAGS:= -fprofile-arcs -ftest-coverage

LOCAL_STATIC_LIBRARIES := libgcov

We got some compilation issues which was resolved by copying the libgcov
library from
prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/android/libgcov.a
using BUILD_PREBUILT make rules.

The output executable size is also increased with this and in out folder was
can see *.gcno files getting created.

When we execute the test *.gcda files are generated on target but when we
try to take the code coverage using lcov it is not generating the code
coverage report.

lcov --directory code_coverage/ --capture --output-file ./code_coverage.info
genhtml -o code_coverage/ ./code_coverage.info

We have tested the same setup with arm-linux toolchain and it works fine.

Please provide some pointer which we can look into.

Regards,
Manish

-- 



Other Threads

1. NoClassDefFoundError for a third party library

Hello all,

actually, I am trying to use a third party library (disco) with
Android.

The third party library is located in external/disco/
In this directory, I have
_Android.mk
_disco_jni.cpp
_libdisco.c
_a directory with c files

I am using:
jdk 1.5.0_17
eclipse
the last sdk

I am launching my emulator with the new system compiled and an sdcard
option which is useful for my test

emulator -sdcard ~/Android/sdcard.img -image ~/mydroid2/out/target/
product/generic/system.img

My project in eclipse consists in a class called Disco which loads the
library and do some stuff after


package android.media;

.....


public class Disco extends Activity implements OnItemClickListener,
OnKeyListener
{
......

static {
        try {
            Log.i("JNI", "Trying to load libdisco.so");
            System.loadLibrary("disco");
        }
        catch (UnsatisfiedLinkError ule) {
            Log.e("JNI", "WARNING: Could not load libdisco.so");
        }
    }

The library is generated before in ~/mydroid2/out/target/product/
generic/system/lib/libdisco.so

When I launch the test I have:

04-07 09:38:50.554: DEBUG/dalvikvm(122): GC freed 2205 objects /
111832 bytes in 116ms
04-07 09:39:03.274: DEBUG/dalvikvm(241): Trying to load lib /system/
lib/libdisco.so 0x434924f8
04-07 09:39:03.304: DEBUG/dalvikvm(241): Added shared lib /system/lib/
libdisco.so 0x434924f8
04-07 09:39:03.344: INFO/System.out(241): PathClassLoader
dalvik.system.pathclassloa...@434924f8: findClass
'android.disco.Disco'
04-07 09:39:03.354: INFO/System.out(241): My path is: /data/app/
android.media.apk
04-07 09:39:03.374: WARN/dalvikvm(241): JNI WARNING: JNI method called
with exception raised
04-07 09:39:03.384: WARN/dalvikvm(241):              in Ljava/lang/
Runtime;.nativeLoad (Ljava/lang/String;Ljava/lang/ClassLoader;)Z
(FindClass)
04-07 09:39:03.384: WARN/dalvikvm(241): Pending exception is:
04-07 09:39:03.384: INFO/dalvikvm(241): Ljava/lang/
NoClassDefFoundError;: android.disco.Disco
04-07 09:39:03.384: INFO/dalvikvm(241):     at
java.lang.Runtime.nativeLoad(Native Method)
04-07 09:39:03.384: INFO/dalvikvm(241):     at
java.lang.Runtime.loadLibrary(Runtime.java:374)
04-07 09:39:03.384: INFO/dalvikvm(241):     at
java.lang.System.loadLibrary(System.java:458)
04-07 09:39:03.384: INFO/dalvikvm(241):     at
android.media.Disco.<clinit>(Disco.java:42)
04-07 09:39:03.384: INFO/dalvikvm(241):     at
java.lang.Class.newInstance(Native Method)
04-07 09:39:03.384: INFO/dalvikvm(241):     at
android.app.Instrumentation.newActivity(Instrumentation.java:1096)
04-07 09:39:03.384: INFO/dalvikvm(241):     at
...
04-07 09:39:03.394: INFO/dalvikvm(241):     at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:739)
04-07 09:39:03.394: INFO/dalvikvm(241):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
04-07 09:39:03.394: INFO/dalvikvm(241):     at
dalvik.system.NativeStart.main(Native Method)
04-07 09:39:03.394: INFO/dalvikvm(241): Caused by:
04-07 09:39:03.394: INFO/dalvikvm(241): Ljava/lang/
ClassNotFoundException;: android.disco.Disco in loader
dalvik.system.pathclassloa...@434924f8
04-07 09:39:03.394: INFO/dalvikvm(241):     at
dalvik.system.PathClassLoader.findClass(PathClassLoader.java:215)
04-07 09:39:03.394: INFO/dalvikvm(241):     at
java.lang.ClassLoader.loadClass(ClassLoader.java:453)
04-07 09:39:03.394: INFO/dalvikvm(241):     at
java.lang.ClassLoader.loadClass(ClassLoader.java:421)
04-07 09:39:03.394: INFO/dalvikvm(241):     at
java.lang.Runtime.nativeLoad(Native Method)
04-07 09:39:03.394: INFO/dalvikvm(241):     at
java.lang.Runtime.loadLibrary(Runtime.java:374)
04-07 09:39:03.394: INFO/dalvikvm(241):     at
java.lang.System.loadLibrary(System.java:458)
04-07 09:39:03.394: INFO/dalvikvm(241):     at
android.media.Disco.<clinit>(Disco.java:42)
04-07 09:39:03.394: INFO/dalvikvm(241):     at
java.lang.Class.newInstance(Native Method)
04-07 09:39:03.394: INFO/dalvikvm(241):     at
android.app.Instrumentation.newActivity(Instrumentation.java:1096)
04-07 09:39:03.394: INFO/dalvikvm(241):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2060)
04-07 09:39:03.394: INFO/dalvikvm(241):     at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2156)
04-07 09:39:03.394: INFO/dalvikvm(241):     at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
04-07 09:39:03.394: INFO/dalvikvm(241):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1580)
04-07 09:39:03.394: INFO/dalvikvm(241):     at
android.os.Handler.dispatchMessage(Handler.java:88)
04-07 09:39:03.394: INFO/dalvikvm(241):     at android.os.Looper.loop
(Looper.java:123)
04-07 09:39:03.394: INFO/dalvikvm(241):     at
android.app.ActivityThread.main(ActivityThread.java:3742)
04-07 09:39:03.394: INFO/dalvikvm(241):     at
java.lang.reflect.Method.invokeNative(Native Method)
04-07 09:39:03.394: INFO/dalvikvm(241):     at
java.lang.reflect.Method.invoke(Method.java:515)
04-07 09:39:03.394: INFO/dalvikvm(241):     at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:739)
04-07 09:39:03.434: INFO/dalvikvm(241):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
04-07 09:39:03.434: INFO/dalvikvm(241):     at
dalvik.system.NativeStart.main(Native Method)
04-07 09:39:03.434: INFO/dalvikvm(241): "main" prio=5 tid=3 NATIVE
04-07 09:39:03.434: INFO/dalvikvm(241):   | group="main" sCount=0
dsCount=0 s=0 obj=0x400113a8
04-07 09:39:03.434: INFO/dalvikvm(241):   | sysTid=241 nice=0
sched=0/0 handle=-1093071716
04-07 09:39:03.434: INFO/dalvikvm(241):   at
java.lang.Runtime.nativeLoad(Native Method)
04-07 09:39:03.434: INFO/dalvikvm(241):   at
java.lang.Runtime.loadLibrary(Runtime.java:374)
04-07 09:39:03.434: INFO/dalvikvm(241):   at
java.lang.System.loadLibrary(System.java:458)
04-07 09:39:03.434: INFO/dalvikvm(241):   at
android.media.Disco.<clinit>(Disco.java:42)
04-07 09:39:03.434: INFO/dalvikvm(241):   at
java.lang.Class.newInstance(Native Method)
04-07 09:39:03.434: INFO/dalvikvm(241):   at
...
04-07 09:39:03.434: INFO/dalvikvm(241):   at
java.lang.reflect.Method.invokeNative(Native Method)
04-07 09:39:03.434: INFO/dalvikvm(241):   at
java.lang.reflect.Method.invoke(Method.java:515)
04-07 09:39:03.434: INFO/dalvikvm(241):   at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:739)
04-07 09:39:03.434: INFO/dalvikvm(241):   at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
04-07 09:39:03.434: INFO/dalvikvm(241):   at
dalvik.system.NativeStart.main(Native Method)
04-07 09:39:03.434: ERROR/dalvikvm(241): VM aborting

Can anyone help me?

Thank you very much

--~--~---------~--~----~------------~-------~--~----~

2. How to find the height of HTML content displayed in a webview

Probably these might help you... I have not tried them though..View.
getScrollX() and View.getScrollY()  and View.scrollTo(int x, int y)

On Wed, Apr 8, 2009 at 4:40 PM, Abraham




--~--~---------~--~----~------------~-------~--~----~

3. Software install

4. HTTP put

5. Cannot pay for applications in UK market

6. Will prices of mac vs. pc's encourage devs over to Android?

7. Is bionic/libc/include/sys/msg.h removed from cupcake branch?