-Wl,-z,now
仅对xsave
指令有帮助,但是record
仍然无法实现,因为它在shlx
指令中失败(在gentoo上使用gdb 8.2.1)... < / p>
$ LDFLAGS="-Wl,-z,now" CFLAGS="-ggdb" make test
cc -ggdb -Wl,-z,now test.c -o test
$ LD_BIND_NOW=1 gdb ./test
Reading symbols from ./test...done.
(gdb) b main
Breakpoint 1 at 0x11aa: file test.c, line 9.
(gdb) run
Starting program: /home/user/pokusy/c/reverse-debug/test
Breakpoint 1, main () at test.c:9
9 int main(void) {
(gdb) record
(gdb) cont
Continuing.
Process record does not support instruction 0xc4 at address 0x7ffff7a94023.
Process record: failed to record execution log.
Program stopped.
0x00007ffff7a94023 in _int_malloc () from /lib64/libc.so.6
(gdb) x/i 0x7ffff7a94023
=> 0x7ffff7a94023 <_int_malloc+1763>: shlx %eax,%ecx,%eax
(gdb)