Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Eclipse cdt debugging an executable within a shell script
Eclipse cdt debugging an executable within a shell script [message #896341] Wed, 18 July 2012 06:56 Go to next message
Zvi Yehudai is currently offline Zvi YehudaiFriend
Messages: 3
Registered: July 2012
Junior Member
I recently started using Eclipse CDT on Linux and like it a lot!!!

I am able to find an answer to almost everything.

I am unable to invoke debugger on a simple executable and I need to do it after running a quite big shell script which sets many environment variables.

My question is simply how to do it, so that eventually, I'll be able to invoke the debugger (GDB) where all environment variables are set by some pre-running shell script.

Alternatively, how do setup a script which - as first stage - sets up the environment, and eventually invokes the Eclipse CDT debugger.

Your assistance is much appreciated.

Regards, -Zvika
Re: Eclipse cdt debugging an executable within a shell script [message #896372 is a reply to message #896341] Wed, 18 July 2012 08:24 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
You have two possibilities.
1) Adapt your Debug Launch Configuration so it has all the environment variables you need and then start your executable directly
2) Adapt your Debug Launch Configuration so that it calls your shell script.
Here is an example for KDE and konsole:
- Set C/C++ application to "/usr/bin/konsole"
- as argument use
-e "bash -c \"./myshellscript.sh; exec bash\""

(the quotes are important!)


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Eclipse cdt debugging an executable within a shell script [message #897381 is a reply to message #896372] Mon, 23 July 2012 20:49 Go to previous messageGo to next message
Zvi Yehudai is currently offline Zvi YehudaiFriend
Messages: 3
Registered: July 2012
Junior Member
Hi Axel,

I tried to follow your receipt, and was kind of stuck. Eventually, I was able to do something along your lines which was good enough for me. I'll have to explore more to make this working stable enough.

Thanks for your advice.

-Zvika
Re: Eclipse cdt debugging an executable within a shell script [message #1768211 is a reply to message #897381] Fri, 14 July 2017 17:30 Go to previous message
Lokesh Kumar is currently offline Lokesh KumarFriend
Messages: 1
Registered: July 2017
Junior Member
what final solution you adopted?
I'm stuck with the same problem.
Previous Topic:Cross GCC
Next Topic:indexer doesn't track active configuration for #ifdefs
Goto Forum:
  


Current Time: Fri Apr 26 14:20:32 GMT 2024

Powered by FUDForum. Page generated in 0.03215 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top