Sign in to follow this  

Linux c++ debugging

This topic is 824 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I had no linux experience coming into my latest job. Some of our code is on linux and I'm so used to visual studio. I've used GDB as a debugger but it's a pain coming from Visual Studio. Are there any suggestions on programming tools on Linux?

Share this post


Link to post
Share on other sites

I had no linux experience coming into my latest job. Some of our code is on linux and I'm so used to visual studio. I've used GDB as a debugger but it's a pain coming from Visual Studio. Are there any suggestions on programming tools on Linux?


Try QtCreator, it should provide a pretty decent graphical interface on top of gdb
other IDEs like code::blocks and eclipse should do the same Edited by SimonForsman

Share this post


Link to post
Share on other sites

I'm using Code::Blocks with gdb(under Linux only), it works fine for me. I heard that QtCreator is better and it has similar hotkeys as VisualStudio(Code::Blocks uses entirely different shortcut keys).

Edited by imoogiBG

Share this post


Link to post
Share on other sites

Look into valgrind. 

 

It can be used to debug, profile, and leak check your code using nothing but the command line, which is great when you can't get access to a gui. 

 

It does have some nice gui tools that work with it though such as kcachegrind. 

 

I don't do any Linux development without it any more...

Share this post


Link to post
Share on other sites

VisualGDB is a commercial product that enables remote GDB support in many versions of Visual Studio.

 

And Visual Studio 2015 comes with official Microsoft support for remote GDB debugging (mainly intended for Android, but you can use it for plain Linux too).

 

Thankfully, there's no reason to sacrifice on your development environment and tools just because of Linux anymore. :)

Share this post


Link to post
Share on other sites

I've never been a fan of DDD because I don't like it's user interface, even though it's a very powerful tool. Haven't used it in a few years though, so who knows. I use KDB myself, which I find a lot easier and more intuitive to use.

Share this post


Link to post
Share on other sites

I use Valgrind primarily. I very rarely need to break out an actual debugger, the times I did I just used gdb and it worked fine, though I could see it worthwhile to invest in both better front-ends and actually learning how to use it efficiently.

Share this post


Link to post
Share on other sites

Netbeans has a pretty good UI for gdb, and it also has the best graphical source control client for Linux. I think they purposely try to rip off VS. It also has some refactoring capabilities for C++.

Same goes for eclipse (although I personally prefer netbeans)

Nost importantly, there are some scripts you can install that will let you view inside STL containers in gdb.

 

I'm actually a VS junkie myself... If I can, I just use C++11 or boost, and debug as much as possible in Visual studio, then run on Linux as late as possible.

 

And +1 for valgrind. It's not my "go-to" debugger, but there's nothing quite like it for finding memory leaks.

Edited by SillyCow

Share this post


Link to post
Share on other sites

And +1 for valgrind. It's not my "go-to" debugger, but there's nothing quite like it for finding memory leaks.

 

Valgrind also has a built in gdbserver too (from version 3.7.0 onwards) so you can connect to it via visual studio etc the same way as anything else speaking the GDB protocol. Have at it! smile.png

Edited by braindigitalis

Share this post


Link to post
Share on other sites

This topic is 824 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this