(编辑:根据当前“技巧”下面的第一个答案,似乎正在使用 Atom 处理器。但我希望一些 gdb 大师可以回答这是一个基本限制,或者是否在路线图上增加对其他处理器的支持?)
反向执行似乎在我的环境中起作用:我可以反向继续,查看合理的记录日志,并在其中移动:
(gdb) start
...Temporary breakpoint 5 at 0x8048460: file bang.cpp, line 13.
Starting program: /home/thomasg/temp/./bang
Temporary breakpoint 5, main () at bang.cpp:13
13 f(1000);
(gdb) record
(gdb) continue
Continuing.
Breakpoint 3, f (d=900) at bang.cpp:5
5 if(d) {
(gdb) info record
Active record target: record-full
Record mode:
Lowest recorded instruction number is 1.
Highest recorded instruction number is 1005.
Log contains 1005 instructions.
Max logged instructions is 200000.
(gdb) reverse-continue
Continuing.
Breakpoint 3, f (d=901) at bang.cpp:5
5 if(d) {
(gdb) record goto end
Go forward to insn number 1005
#0 f (d=900) at bang.cpp:5
5 if(d) {
但是指令和功能历史不可用:
(gdb) record instruction-history
You can't do that when your target is `record-full'
(gdb) record function-call-history
You can't do that when your target is `record-full'
唯一可用的目标类型是完整的,另一个记录的类型“btrace”失败,并显示“目标不支持分支跟踪”。
所以很可能它只是不支持这个目标,但因为它是一个主流的现代目标(gdb 7.6.1-ubuntu,在 amd64 Linux Mint“Petra”上运行“Intel(R) Core(TM) i5-3570” ) 我希望我忽略了一个关键步骤或配置?