1

In Windows you can use a default debugger (gflag) that is called when a image name is run. Can be this done with GDB and Linux? In Windows it's useful for debugging services.

Regards.

2 Answers 2

1

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 ;-)

Sign up to request clarification or add additional context in comments.

Comments

0

yes, from the command line run:

gdb --args [program] [options]

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.