gdb中的“target record-full”使printf上的“n”命令失败并且“进程记录不支持地址0x7ffff7dee6e7处的指令0xc5”?

我想在gdb中使用“reverse-step”和“reverse-next”命令。 堆栈溢出告诉我,我应该在执行上下文中运行“target record-full”,我希望“rn”和“rs”。 但是发生了一些奇怪的错误:

1 2 #include 3 int i=0; 4 void fa() 5 { 6 ++i; 7 printf("%d\n",i); 8 ++i; 9 } 10 int main(){ 11 fa(); 12 return 0; 13 } 

我编译并运行这个程序:

 (gdb) b 4 Breakpoint 1 at 0x40052a: file test02.c, line 4. (gdb) r Starting program: /home/Troskyvs/a.out Breakpoint 1, fa () at test02.c:6 6 ++i; (gdb) target record-full (gdb) n 7 printf("%d\n",i); (gdb) n # Error happens here! Process record does not support instruction 0xc5 at address 0x7ffff7dee6e7. Process record: failed to record execution log. Program stopped. _dl_runtime_resolve_avx () at ../sysdeps/x86_64/dl-trampoline.h:81 81 ../sysdeps/x86_64/dl-trampoline.h: No such file or directory. 

好吧,如果我不运行“目标记录已满”,那么第二个“n”就可以运行到下一行了。 我不太明白这里的错误信息。

它与“目标记录已满”有关吗? 我怎么能喝酒呢?

我尝试了另一种方法:

 (gdb) set exec-direction reverse (gdb) n No more reverse-execution history. fa () at test02.c:7 7 printf("%d\n",i); (gdb) n No more reverse-execution history. fa () at test02.c:7 7 printf("%d\n",i); (gdb) n 

好吧,它不起作用

从GDB 7.11.1开始不支持AVX

基本问题似乎是目前不支持AVX指令,但glibc在Ubuntu 16.04 64位上使用它们:

rr是一个很棒的工作替代方案: https : //github.com/mozilla/rr这是一个最小的工作示例: 在GDB中设置断点,函数返回

实际上,对于你所拥有的简单情况,如果在gcc编译命令中添加参数“-static”,则记录已满。