开发者

GDB as default debugger

In Windows you can use a default debugger (gflag) that is called when a image name i开发者_如何学运维s run. Can be this done with GDB and Linux? In Windows it's useful for debugging services.

Regards.


There is no way to do this on Linux, short of hacking your kernel.

Nor is it usually necessary. If you always want to run e.g. /foo/bar under GDB, just do this:

mv /foo/bar /foo/bar.x
cat > /foo/bar <<EOF
#!/bin/bash
exec gdb --args /foo/bar.x "$@"
EOF
chmod +x /foo/bar

Problem solved ;-)


yes, from the command line run:

gdb --args [program] [options]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜