“目标记录已满"在 gdb 中生成“n";printf 命令失败,“进程记录不支持地址 0x7ffff7dee6e7 处的指令 0xc5"? [英] "target record-full" in gdb makes "n" command fail on printf with "Process record does not support instruction 0xc5 at address 0x7ffff7dee6e7"?
问题描述
我想在 gdb 中使用reverse-step"和reverse-next"命令.堆栈溢出告诉我应该在我希望rn"和rs"的执行上下文中运行target record-full".但是发生了一些奇怪的错误:
I was tring to use "reverse-step" and "reverse-next" command inside gdb. Stack overflow tells me that I should run "target record-full" in the execution context where I wish to "rn" and "rs". But some weird error happened:
1
2 #include<stdio.h>
3 int i=0;
4 void fa()
5 {
6 ++i;
7 printf("%d
",i);
8 ++i;
9 }
10 int main(){
11 fa();
12 return 0;
13 }
我编译并运行这个程序:
I compile and run this program:
(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
",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.
好吧,如果我不运行target record-full",那么第二个n"就可以并运行到下一行.我不太了解这里的错误信息.
Well if I don't run "target record-full", then the 2nd "n" will be OK and run to next line. I don't quite get the error information here.
是否与目标记录已满"有关?我该如何征服它?
Is it related to "target record-full"? How can I conquor it?
我尝试了另一种方法:
(gdb) set exec-direction reverse
(gdb) n
No more reverse-execution history.
fa () at test02.c:7
7 printf("%d
",i);
(gdb) n
No more reverse-execution history.
fa () at test02.c:7
7 printf("%d
",i);
(gdb) n
这样不行
推荐答案
从 GDB 7.11.1 开始不支持 AVX
根本问题似乎是当前不支持 AVX 指令,但 glibc 在 Ubuntu 16.04 64 位上使用它们:
The underlying problem seems to be that AVX instructions are not currently supported, but glibc uses them on Ubuntu 16.04 64-bit:
rr
是一个很棒的替代方案:https://github.com/mozilla/rr 这是一个最小的工作示例:在函数返回的GDB中设置断点
rr
is an awesome working alternative: https://github.com/mozilla/rr Here is a minimal working example: Setting breakpoint in GDB where the function returns
这篇关于“目标记录已满"在 gdb 中生成“n";printf 命令失败,“进程记录不支持地址 0x7ffff7dee6e7 处的指令 0xc5"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!