Starting ddd with remote gdbserver

帅比萌擦擦* 提交于 2019-12-09 05:51:13

问题


I'm debugging a program that runs on a remote target using ddd ( the remote gdbserver is running on localhost over port 1234 for example, but still acts as remote).

I know you can connect to the gdbserver by opening ddd, then calling target remote localhost:1234 on the gdb command line of ddd, as described in:
http://www.gnu.org/software/ddd/manual/html_mono/ddd.html#Remote%20Program

However, I hate having to call the target remote localhost:1234 command every time I open ddd, and I'd like to set it to connect to the gdbserver automatically with an alias. I tried running ddd --rhost localhost:1234 program, but once ddd launches a window pops stating that "GDB could not be started", and in the shell written:

sh: 1: exec: localhost:1234: not found

Anyone knows how can I attach to the remote gdbserver right on launch?

Tnx!


回答1:


Choose one of:

  1. ddd --eval-command="target remote localhost:1234"
  2. put target remote localhost:1234 into a file and use --command to execute it
  3. put target remote localhost:1234 into your .gdbinit


来源:https://stackoverflow.com/questions/15096506/starting-ddd-with-remote-gdbserver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!