我有以下代码:
#include <iostream>
#include <random>
int main() {
std::mt19937_64 rng(std::random_device{}());
std::cout << std::uniform_int_distribution<>(0, 100)(rng) << '\n';
}
我尝试使用 来分析它valgrind
,但它说:
vex amd64->IR: unhandled instruction bytes: 0xF 0xC7 0xF0 0x89 0x6 0xF 0x42 0xC1
vex amd64->IR: REX=0 REX.W=0 REX.R=0 REX.X=0 REX.B=0
vex amd64->IR: VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=0F
vex amd64->IR: PFX.66=0 PFX.F2=0 PFX.F3=0
==2092== valgrind: Unrecognised instruction at address 0x4cdc1b5.
==2092== at 0x4CDC1B5:std::(anonymous namespace)::__x86_rdrand() (random.cc:69)
==2092== by 0x4CDC321: std::random_device::_M_getval() (random.cc:130)
==2092== by 0x4009D4: main (random.h:1619)
前面有多个实例:
--2092-- WARNING: Serious error when reading debug info
--2092-- When reading debug info from /lib/x86_64-linux-gnu/ld-2.22.so:
--2092-- Ignoring non-Dwarf2/3/4 block in .debug_info
我在 Debian 上使用 x86-64 平台上的标准包,使用 valgrind-3.11.0 使用 gcc 5.3.1 编译。非法指令似乎在 libstdc++6 中。
如何valgrind
分析我的代码?