how to debug application as root in eclipse in Ubuntu?

后端 未结 8 1267

I\'m programming application using libpcap. when I debug the application in normal mode, pcap cannot get the network device. it seems that I have to debug the application in

8条回答
  •  北荒
    北荒 (楼主)
    2020-12-07 16:16

    You can use gdbserver on localhost to attach a existing process, the following is the command line:

    sudo gdbserver : --attach 
    

    Or you can create a new process using gdbserver:

    sudo gdbserver : 
    

    Then you can create a debugging configuration in Eclipse, in the debugger tab, the debugger item, select gdbserver, and input the listening port in the connection tab in the bellow.

提交回复
热议问题