![](/img/trans.png)
[英]how perf record get the virtual memory address of instruction of the target process and what data struct does perf use to store it
[英]“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”命令。 堆棧溢出告訴我,我應該在執行上下文中運行“target record-full”,我希望“rn”和“rs”。 但是發生了一些奇怪的錯誤:
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 }
我編譯並運行這個程序:
(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在64位Ubuntu 16.04上使用它們:
rr
是一個很棒的工作替代方案: https : //github.com/mozilla/rr這是一個最小的工作示例: 在GDB中設置斷點,函數返回
實際上,對於你所擁有的簡單情況,如果在gcc編譯命令中添加參數“-static”,則記錄已滿。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.