Есть несколько способов сделать это. Проще всего проверить, gdbесть ли в вашем $PATH:
which -a gdb
Однако программа может быть установлена и не у вашего пользователя $PATH. Чтобы быстро найти исполняемый файл с именем, gdbсделайте это:
locate -eb '\gdb'
От man locate:
NAME locate - find files by name -b, --basename Match only the base name against the specified patterns. This is the opposite of --whole‐ name. -e, --existing Print only entries that refer to files exist‐ ing at the time locate is run. EXAMPLES To search for a file named exactly NAME (not *NAME*), use locate -b '\NAME' Because \ is a globbing character, this disables the implicit replacement of NAME by *NAME*.
1
justbrowsing
Это буквально означает, что GDB не находится в $PATHили не является исполняемым.
Но да, он должен быть установлен /usr/bin/gdbв каталог PATH, и каталог /etc/gdbдолжен существовать.
Кроме того, обычный дистрибутив, который вы используете?
Должен ли я иметь root-доступ для проверки выше или нет? Потому что я не ...
Dchris 10 лет назад
0
Нет, `ls` должен работать, однако довольно очевидно, что [скорее всего]` gdb` не установлен.
justbrowsing 10 лет назад
1
1
Mayank Agarwal
Type a simple whereis comand whereis is useful utility to locate the binary, source, and manual page files for a command
whereis -b gdb The switch -b is for locating the binary
$whereis -b gdb If you get the o/p like this gdb: /usr/bin/gdb /etc/gdb /usr/include/gdb /usr/share/gdb
The most important is the presence in the /usr/bin/gdb directory where all executes files are present. If the o/p of whereis -b gdb returns null, u need to install gdb