On Android shell:
/data/local/valgrind/enter code herebin/valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --log-file=/sdcard/valgrind.log /data/local/Test
========================================================================
valgrind.log--HEAP SUMMARY:
==21314== HEAP SUMMARY:
==21314== in use at exit: 2,098,270 bytes in 6 blocks
==21314== total heap usage: 6 allocs, 0 frees, 2,098,270 bytes allocated
==21314==
==21314== 4 bytes in 1 blocks are definitely lost in loss record 1 of 6
==21314== at 0x482BAEC: malloc (vg_replace_malloc.c:291)
==21314== by 0x864B: ??? (in /data/local/Test)
==21314==
==21314== 10 bytes in 1 blocks are definitely lost in loss record 2 of 6
==21314== at 0x482BAEC: malloc (vg_replace_malloc.c:291)
==21314== by 0x863B: ??? (in /data/local/Test)
==21314==
==21314== 80 bytes in 1 blocks are definitely lost in loss record 3 of 6
==21314== at 0x482C2E4: operator new[](unsigned int) (vg_replace_malloc.c:378)
==21314== by 0x85DF: ??? (in /data/local/Test)
==21314==
==21314== 1,024 bytes in 1 blocks are still reachable in loss record 4 of 6
==21314== at 0x482BAEC: malloc (vg_replace_malloc.c:291)
==21314== by 0x4852DB3: __smakebuf (in /system/lib/libc.so)
==21314==
==21314== 1,048,576 bytes in 1 blocks are possibly lost in loss record 5 of 6
==21314== at 0x482BAEC: malloc (vg_replace_malloc.c:291)
==21314== by 0x86C3: ??? (in /data/local/Test)
==21314==
==21314== 1,048,576 bytes in 1 blocks are definitely lost in loss record 6 of 6
==21314== at 0x482BAEC: malloc (vg_replace_malloc.c:291)
==21314== by 0x869F: ??? (in /data/local/Test)
==21314==
==21314== LEAK SUMMARY:
==21314== definitely lost: 1,048,670 bytes in 4 blocks
==21314== indirectly lost: 0 bytes in 0 blocks
==21314== possibly lost: 1,048,576 bytes in 1 blocks
==21314== still reachable: 1,024 bytes in 1 blocks
==21314== suppressed: 0 bytes in 0 blocks
==21314==
==21314== For counts of detected and suppressed errors, rerun with: -v
==21314== ERROR SUMMARY: 137 errors from 18 contexts (suppressed: 0 from 0)
the Android.mk:
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := Test LOCAL_SRC_FILES := helloworld.cpp APP_CPPFLAGS += -O0 include $(BUILD_EXECUTABLE)**
On Linux I run ndk-build NDK_DEBUG=1
so this Test is debugable, why doesn't the valgrind log show the line numbers?