我有这样的东西:
uint8_t *data = (uint8_t *) 3;
*data = 1;
这将显示足够的回溯
Object "/lib/libc.so.6", at 0xb6d07d33, in __libc_start_main
Object "./test_log", at 0xdbee3, in main
Object "/lib/libc.so.6", at 0xb6d1d9cf, in
但是当我像这样使用memcpy时:
memcpy((void *) 3, 0, 3);
不会显示有用的回溯,
Object "/data/running_environment/debug2/libc.so.6", at 0xb57ab8b7, in
Object "/data/running_environment/debug2/libc.so.6", at 0xb577521f, in
但是,我已经用标志重新编译了libc
../configure --host=arm-linux-gnueabihf --enable-stack-protector=strong --prefix=my_path/glibc-2.28/build/install CFLAGS="-O2 -g3 -funwind-tables -mapcs-frame -funwind-tables -rdynamic -funwind-tables "
并用标志编译我的测试:
-O0 -g -Wall -std=c++14 -g3 -fexceptions -ffunction-sections -rdynamic -funwind-tables -fasynchronous-unwind-tables -mfpu=neon