简体   繁体   中英

Remote debugging C++ application with Eclipse GUI

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 xxxx: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 .

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.

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".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM