Remote GDB debugging

前端 未结 2 1914
借酒劲吻你
借酒劲吻你 2021-02-05 12:22

I\'ve just spent a whole day trying to find a way to enable GDB debugging from Qt Creator or Eclipse. I learned that there are basically two approaches to launch the target appl

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-05 13:11

    So that GDB on your host (the machine you develop and compile on, so where you have Qt Creator) you have to give it access to the "symbol file".

    I usually don't use Qt Creator, but GDB and gdbserver directly for cross-compiled programs remote-debugging. You could maybe give this a try to be sure that this works for you and maybe then find the missing option in Qt Creator (or maybe this will help you find what is missing).

    On the target machine run:

    gdbserver :5000 yourprogram
    

    On the host machine, run gdb and then load the symbol file:

    (gdb) symbol-file yourprogram
    

    On GDB on the host machine, you then have to connect to connect GDB to the remote gdbserver:

    (gdb) target remote target_ip_address:5000
    

    From then you can use GDB on the host controlling the program on the target.

    I hope this helps!

提交回复
热议问题