Remote debugging C++ application with Eclipse GUI

不羁岁月 提交于 2021-02-17 22:52:15

问题


I followed the steps in this link and I manage to debug a binary which resides in linux host from my windows machine from command prompt.

I have gdbserver in linux and I installed gdb with the help of mingw in windows. As I told I can prompt "target remote x.x.x.x:10000 test" to command in windows and debug my test application.

My problem is I can't do the same with eclipse gui, it seems to me it has tones of buttons, options but they make no sense to me.

I am choosing debug_configurations-->C/C++ Remote Application(the only one which allows me to input linux machine ip/port), in "Main" tab to connection I am inputting my linux ip. In same menu under Debugger tab I am inputting my window's gdb path and gdbserver port.

After doing all those I believe I gave enough info to eclipse for connect gdb server but it never enough for eclipse. I am checking gdbserver logs by starting gdbserver with --debug, gdbserver never gets triggered, it does not writes a single line of log. Eclipse even does not starts a connection. But instead it gives me a error like "Error during file upload." which makes no sense to me.

I am using "Eclipse Version: Juno Service Release 2" . Any help will be appreciated .


回答1:


I believe that the "C/C++ Remote Application" option uses Eclipse's RDT (Remote Development Tools) and RSE (Remote System Explorer) to connect, upload, execute, and debug the application itself. It

If all you want to do is connect to a gdbserver, then create a "C/C++ Attach to Application" debug configuration, and under the Debugger tab, set Debugger to gdbserver.




回答2:


I also encountered this error message for other reason on Eclipse version 2019-09 R (4.13.0). I very recommend to read paragraph "How do I debug a remote application?" from this great guide.

It explains which of three remote debugging options you should be using - Automatic Remote Launcher, Manual Remote Launcher and Remote Attach Launcher and how to use each one.

I was using the wrong launcher and hence got the error, while on the remote side gdbserver was listening and waiting for a connection. Switching to Manual Remote Launcher solved it.

for example it says:

If you don't have RSE installed, you cannot use the "Automatic Remote Launch"

RSE = Remote System Explorer End-User Runtime

Launcher setting is configured from the bottom of the Remote Debug Configuration window - "Using GDB (DSF) Automatic/Manual Remote Debugging Launcher".



来源:https://stackoverflow.com/questions/24040690/remote-debugging-c-application-with-eclipse-gui

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