1.在makefile里添加了-g:
$(BIN) : $(OBJECTS)
$(CC) $(LDFLAGS) -g -o $@ $(OBJECTS) $(LIBS)
2.交叉编译后拿到arm上测试:
valgrind --leak-check=full ./sensor_daemon
3.结果没有行号:
==3588== Memcheck, a memory error detector
==3588== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==3588== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==3588== Command: ./sensor_daemon
==3588==
Connection established with kernel.
resource->hdr_mode:0 HDR_PIPELINE_ADV:2
resource->hdr_expo_num:1, HDR_2X:2 night_mode:0
---load mliso_adj_param---
!!! [/home2/alwyn/sdk2.6_all_trunk/src/sysapps/vendor/packages/img_mw/mw/arch_s2l/src/mw_image_priv_spot_mode_rc845.c: 673]/etc/idsp/adj_params/imx307_mliso_adj_param_oc845.bin /etc/idsp/adj_params/imx307_aeb_param_oc845.bin
pipline:1, hdr_mode:0, expo_num:1, raw_pitch:0
main:size 1920x1088, raw:1920x1088, resolution:10
==3588== Thread 2:
==3588== Conditional jump or move depends on uninitialised value(s)
==3588== at 0x41C96: ??? (in /usr/local/bin/sensor_daemon)
==3588==
==3588== Conditional jump or move depends on uninitialised value(s)
==3588== at 0x4D5267C: mmap (mmap.S:38)
==3588== by 0x41CA5: ??? (in /usr/local/bin/sensor_daemon)
==3588==
==3588== Syscall param mmap2(length) contains uninitialised byte(s)
==3588== at 0x4D52688: mmap (mmap.S:42)
==3588== by 0x41CA5: ??? (in /usr/local/bin/sensor_daemon)
==3588==
==3588== Syscall param mmap2(offset) contains uninitialised byte(s)
==3588== at 0x4D52688: mmap (mmap.S:42)
==3588== by 0x41CA5: ??? (in /usr/local/bin/sensor_daemon)
==3588==
==3588== Conditional jump or move depends on uninitialised value(s)
==3588== at 0x41D0A: ??? (in /usr/local/bin/sensor_daemon)
==3588== Source and destination overlap in memcpy(0x59b40c0, 0x59b40c0, 20)
==3588== at 0x4843558: memcpy (in /usr/local/lib/valgrind/vgpreload_memcheck-arm-linux.so)
==3588==
no translater for filter 10
==3588== Thread 4:
==3588== Syscall param ioctl(generic) points to uninitialised byte(s)
==3588== at 0x4D4FC36: ioctl (syscall-template.S:81)
==3588== by 0x2782D: ??? (in /usr/local/bin/sensor_daemon)
==3588== Address 0x6eadb54 is on thread 4's stack
==3588==
==3588== Syscall param ioctl(generic) points to uninitialised byte(s)
==3588== at 0x4D4FC36: ioctl (syscall-template.S:81)
==3588== by 0x279B9: ??? (in /usr/local/bin/sensor_daemon)
==3588== Address 0x6eadba0 is on thread 4's stack
...........
这是arm上的测试结果,如何才能获得出错的行号来定位错误信息。