使用选项在 gdb 中运行程序

Runing a program in gdb with an option

有一个程序我通常 运行 使用 -t 就像在 ./program -t 中一样,但是当我这样做时 gdb ./program -t,它说

gdb: option '-t' is ambiguous; possibilities: '-tui' '-tty'
Use `gdb --help' for a complete list of options.

我也试过 gdb --args ./program -t 但它也不起作用(returns 没有这样的文件或目录)。有什么办法可以 运行 在 gdb 中使用 -t 这个程序吗?

I've tried gdb --args ./program -t as well

这是调用程序的正确方法。

你也可以这样做:

gdb ./program
(gdb) run -t

but it doesn't work either (returns no such file or directory)

这可能意味着 ./program 不存在,或者无法在您的系统上运行。或者你的 ~/.gdbinit./.gdbinit.

中可能有一些非标准的东西