我从使用fedora rpm specfile从源代码构建的centos7,clang-3.6.1获得了完全相同的结果.Ubuntu 14.04,clang-3.4
使用wiki中的说明https://github.com/google/sanitizers/wiki/MemorySanitizerLibcxxHowTo 尽可能接近.该页面最后更新6个月前.
谷歌版本613仍在使用tr1
In file included from /home/hal/googletest/src/gtest-all.cc:39:
In file included from /home/hal/googletest/include/gtest/gtest.h:58:
In file included from /home/hal/googletest/include/gtest/internal/gtest-internal.h:40:
/home/hal/googletest/include/gtest/internal/gtest-port.h:507:13: fatal error:
'tr1/tuple' file not found
# include <tr1/tuple> // NOLINT
^
1 error generated.
Run Code Online (Sandbox Code Playgroud)
将googletest更新为tip(746)并编译以下警告
? [hal@davis 9:54 ~/gtest-msan] make
Scanning dependencies of target gtest
[ 50%] Building CXX object CMakeFiles/gtest.dir/src/gtest-all.cc.o
clang: warning: -lc++abi: 'linker' input unused
clang: warning: -lc++abi: 'linker' input unused
clang: warning: argument unused during compilation: '-L/home/hal/libcxx_msan/lib'
clang: warning: argument unused during …Run Code Online (Sandbox Code Playgroud) 所以我有一个新的花哨cpu支持avx2指令集.这很好,但打破了gdb反向调试.在没有优化的情况下进行编译时,代码仍然使用共享库,例如调用memset()然后调用memset的avx2优化版本.这很好,但gdb记录不支持avx2.
进程记录不支持地址0x7ffff690dd80处的指令0xc5.
0xc5是这里的vex前缀.
反向调试适用于不支持avx2的cpu.如何让libc等不使用avx2优化版本的库调用,以便我可以使用gdb记录,向后退步等?
我试过了
LD_BIND_NOW=1
LD_HWCAP_MASK=0
compiling with -static
Run Code Online (Sandbox Code Playgroud)
如果没有在旧机器上调试,我就没有想法了.