Is it somehow possible to use ltrace
and gdb
at the same time? I have a small stripped binary program, where I would like to see the variable contents, of some library calls I can see with ltrace
.
Is it somehow possible to attach gdb and ltrace to the same process?
No, both gdb and ltrace use
ptrace
to debug and trace process, and tracee (target) process may be attached only to single ptrace tracer.You may try implement some call tracing inside gdb with
breakpoint function_name
orb function_addr
, getting breakpoint id and adding gdbcommands
to execute at this breakpoint, for example for breakpoint with number 1:gdb will print backtrace (bt), and rax register value, then it will continue execution (more examples and disabling of pagination is at What are the best ways to automate a GDB debugging session?).
Or you can try in-kernel tracing solution like
sysdig
.