gdb的命令例子
一个重指向的应用
已经运行并默认输出到tty的pid,使用gdb修改 STDOUT/STDERR, 转
- attach to the process in question using gdb, and run:
p dup2(open("/dev/null", 0), 1)
p dup2(open("/dev/null", 0), 2)
detach
quit
已经运行并默认输出到tty的pid,使用gdb修改 STDOUT/STDERR, 转
p dup2(open("/dev/null", 0), 1)
p dup2(open("/dev/null", 0), 2)
detach
quit