8

我正在使用 ddd 调试在远程目标上运行的程序(例如,远程 gdbserver 在 localhost 上通过端口 1234 运行,但仍充当远程)。

我知道你可以通过打开 ddd 连接到 gdbserver,然后调用 dddtarget remote localhost:1234的 gdb 命令行,如:
http ://www.gnu.org/software/ddd/manual/html_mono/ddd.html#Remote% 20程序

target remote localhost:1234但是,我讨厌每次打开 ddd 时都必须调用该命令,并且我想将其设置为使用别名自动连接到 gdbserver。我尝试运行ddd --rhost localhost:1234 program,但是一旦 ddd 启动一个窗口,提示“GDB 无法启动”,并在 shell 中写道:

sh: 1: exec: localhost:1234: 未找到

任何人都知道如何在启动时附加到远程 gdbserver?

天呐!

4

1 回答 1

7

选择以下之一:

  1. ddd --eval-command="target remote localhost:1234"
  2. 放入target remote localhost:1234文件并用于--command 执行它
  3. 放入target remote localhost:1234你的.gdbinit
于 2013-02-28T02:56:38.667 回答