开发者

GDB as default debugger

开发者 https://www.devze.com 2023-02-19 06:43 出处:网络
In Windows you can use a default debugger (gflag) that is called when a image name i开发者_如何学运维s run.

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

精彩评论

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