简体   繁体   English

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

[英]“target record-full” in gdb makes “n” command fail on printf with “Process record does not support instruction 0xc5 at address 0x7ffff7dee6e7”?

I was tring to use "reverse-step" and "reverse-next" command inside gdb. 我想在gdb中使用“reverse-step”和“reverse-next”命令。 Stack overflow tells me that I should run "target record-full" in the execution context where I wish to "rn" and "rs". 堆栈溢出告诉我,我应该在执行上下文中运行“target record-full”,我希望“rn”和“rs”。 But some weird error happened: 但是发生了一些奇怪的错误:

  1 
  2 #include<stdio.h>
  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 } 

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\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.

Well if I don't run "target record-full", then the 2nd "n" will be OK and run to next line. 好吧,如果我没有运行“目标记录已满”,那么第二个“n”就可以运行到下一行了。 I don't quite get the error information here. 我不太明白这里的错误信息。

Is it related to "target record-full"? 它与“目标记录已满”有关吗? How can I conquor it? 我怎么能调酒呢?

I tried another approach: 我尝试了另一种方法:

(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

Well, it doesn't work 好吧,它不起作用

AVX is not supported as of GDB 7.11.1 从GDB 7.11.1开始不支持AVX

The underlying problem seems to be that AVX instructions are not currently supported, but glibc uses them on Ubuntu 16.04 64-bit: 基本问题似乎是目前不支持AVX指令,但glibc在64位Ubuntu 16.04上使用它们:

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM