Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
879 views
in Technique[技术] by (71.8m points)

c - "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. 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.

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?

I tried another approach:

(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

Well, it doesn't work

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

AVX is not supported as of GDB 7.11.1

The underlying problem seems to be that AVX instructions are not currently supported, but glibc uses them on Ubuntu 16.04 64-bit:

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...