Onye
Onye

Reputation: 205

Show the location of the executable in GDB

I suspect my gdb is accessing the wrong program location when I try to run it with "gdb [executable-name]". Is there anything I can do to have gdb output the location of the executable that's being debugged?

Upvotes: 1

Views: 1634

Answers (1)

Employed Russian
Employed Russian

Reputation: 213859

I suspect my gdb is accessing the wrong program location when I try to run it with "gdb [executable-name]".

GDB will look for ./executable-name, and then search $PATH.

GDB info file will tell you what binary it's currently using.

P.S. If in doubt, simply pass the absolute path to your binary explicitly: gdb /path/to/executable-name.

Upvotes: 1

Related Questions