Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do remote debugging with Eclipse CDT without gdbserver?

We're using the Eclipse CDT 5 C++ IDE on Windows to develop a C++ application on a remote AIX host.

Eclipse CDT has the ability to perform remote debugging using gdbserver. Unfortunately, gdbserver is not supported on AIX.

Is anyone familiar with a way to debug remotely using Eclipse CDT without gdbserver? Perhaps using an SSH shell connection to gdb?

like image 253
Michael Harding Avatar asked Sep 17 '08 08:09

Michael Harding


People also ask

What is remote debugging?

In simple terms, remote debugging is debugging an application that runs in a place other than your local environment. This is usually done by connecting the remotely running application with your development environment.

How do I turn off remote debugging?

05 On the General settings panel, under Debugging, select Off next to Remote debugging setting to disable remote debugging using Microsoft Visual Studio for the selected Azure App Services web application. Click Save to apply the changes.

How do I enable remote debugging in gdb?

You need to tell GDB how to access to your program's binaries with a set sysroot command, you need to obtain a local copy of the main executable and supply that to GDB with a file command, and you need to tell GDB to commence remote debugging with a target remote command. Until now. Now all you need is the target remote command.

How to debug a remote application in Eclipse?

Eclipse remote development pluginNow it’s time to add a debug configuration for remote debugging: select menu “Run > Debug Configurations …” and follow on the left side “C/C++ Remote Application” then press “+” icon on the top to generate related configuration.

Is the gdbsever plugin required for Eclipse?

(The gdbsever is not required by this plugin). The debugger invokes the program in the remote system and starts debugging it. The source code files in the eclipse project can be a copy of the remote source code which is used to build the program.

Can I run Eclipse CDT + GDB on Raspberry Pi?

I have just open an Eclipse CDT + GDB connection to a Raspberry Pi gdbserver, works fine. Building class - what are these for - Final class , Unit test ? Powered by FUDForum.


2 Answers

finally I got gdb run remotly anyhow now. At the Bug-symbol on the taskbar I took Debug Configurations - GDB Hardware Debugging.

In Main C/C++ Applications I set the full path on the Samba share of the executable (X:\abin\vlmi9506). I also set a linked folder on X:\abin in the project. Then I modified my batch-script in GDB Setup. It's not directly calling gdb in the plink-session but a unix-shell-script, which opens gdb. By this I have the possibility to set some unix environment-variables for the program before doing debug. The call in my batch:

plink.exe prevoax1 -l suttera -pw XXXXX -i /proj/user/dev/suttera/vl/9506/test/vlmi9506ddd.run 20155 dev o m

In the unix script I started gdb with the command line params from eclipse, that I found in my former tryals. The call in the shell command looks like this:

gdb -nw -i mi -cd=$LVarPathExec $LVarPathExec/vlmi9506

Then IBM just gives gdb 6.0 for AIX. I found version 6.8 in the net at http://www.perzl.org/aix/index.php?n=Main.Gdb. Our Admin installed it.

I can now step through the program and watch variables. I even can write gdb-commands directly in the console-view. yabadabadooooooo

Hope that helps to others as well. Can not tell, what was really the winner-action. But each answer gives more new questions. Now I got 3 of them.

  1. When I start the debug config I have to click restart in the toolbar to come really in the main procedure. Is it possible to come directly in main without restarting?
  2. On AIX our programs are first preprocessed for embedded sql. The preprocessed c-source is put in another directory. When I duble-click the line to set a breakpoint, I get the warning "unresolved breakpoint" and in the gdb-console I see, that the break is set to the preprocessed source which is wrong. Is it possible to set the breakpoints on the right source?
  3. We are using CICS on AIX. With the xldb-Debugger and the CDCN-command of CICS we manage that debugging is started, when we come in our programs. Is it possible to get that remotely (in plink) with gdb-eclipse as well?
like image 163
Gooner Avatar answered Sep 26 '22 12:09

Gooner


I wouldn't normally take a shot in the dark on a question I can't really test the answer to, but since this one has sat around for a day, I'll give it a shot. It seems from looking at:

http://wiki.eclipse.org/TM_and_RSE_FAQ#How_can_I_do_Remote_Debugging_with_CDT.3F

...that even if the CDT has changed since that wiki page was made, you should still be able to change the debug command to:

ssh remotehost gdb

instead of using TM which uses gdbserver. This will probably be slightly slower than the TM remote debugging since that actually uses a local gdb, but on the other hand this way you won't have to NFS or SMB mount your source code to make it available to the local debugger (and if you're on a LAN it probably won't matter anyhow).

There's also a reference TCF implementation for linux, which you may or may not have any luck recompiling for AIX, but it allows for remote debugging if gdbserver is otherwise not available:

http://wiki.eclipse.org/DSDP/TM/TCF_FAQ

like image 29
Nick Bastin Avatar answered Sep 25 '22 12:09

Nick Bastin