Linux Standalone Debuggers

Slow watch window sounds like a real pain, but hey, beggars can't be choosers on Linux when it comes to debuggers. I'll give it a shot. When people recommended it previously, it was not yet in a state where it could debug an external executable (at least according to the CLion devs)... so if that's working now, I can give it a shot.

- Casey
cmuratori
Slow watch window sounds like a real pain, but hey, beggars can't be choosers on Linux when it comes to debuggers. I'll give it a shot. When people recommended it previously, it was not yet in a state where it could debug an external executable (at least according to the CLion devs)... so if that's working now, I can give it a shot.

- Casey


Yeah, I think they added this ability in 1.0 according to this - https://youtrack.jetbrains.com/issue/CPP-710

Also, somebody from the CLion dev team responded to my post:
https://medium.com/@anastasiakaza...eresting-clion-usage-492123e30447
She thinks debugging without a "proper" project like this can cause issues. I haven't noticed any yet, but beware...

Some other notes so far:
* No way to view assembly yet, it’s on their list
* During debugging, it shows the current value of some variables (mostly stack ones that I could see) next to their definitions as a sort of comment in the code, which can be handy.

Edited by AndrewJDR on
Hello,

I'm trying to use Qt Creator for debugging on Linux (for a side project).

As for now I open Qt Creator and then I click Debug/Start Debugging/Start and Debug external Application. Then I break at main and everything works fine. I set up a hotkey to do that and I only have to click "Ok" after that.

Is there any way to do that better? Like open from the command line? Or something that doesn't bring the "start dialog" up and just runs it in qt creator?

I would appreciate some help how to set up for debugging external applications nicely. :)
DomsL
Is there any way to do that better? Like open from the command line? Or something that doesn't bring the "start dialog" up and just runs it in qt creator?


Perhaps this will work from the command line:
1
qtcreator -debug some.exe


For more info, check the official documentation.
I usually set up a dummy project, then set the "run" settings to create a custom run config to point to my application/parameters/dir.

- Casey
Thank you.

I was hoping it would create a dummy project similar to Visual Studio creating a "standard" solution out of the handmade.exe. But setting it up myself will work too. :)

As far as the command line arguments go, I didn't see any options to start a console application. (I think you can choose something like "run in terminal" normally, so I could see my debug output to stdout)
I've been using Eclipse Luna CDT in Linux and it just works as a stand-alone debugger. Just File -> Import -> C/C++ -> C/C++ Executable. Then you go through configuring the debug settings and you're done. So far, works fairly well. I do the same thing on OS X because XCode sucks.
Thanks a lot for that. Despite the fact that I am a daily follower of handmade hero, I found your answer through Google for a totally different project I am working on. Clion is a relief compared to other frontends on Linux :).
Visual Studio Code on Linux now supports debugging of standalone C++ apps:
http://code.visualstudio.com/docs/languages/cpp

First install:
https://code.visualstudio.com/

Then install:
https://marketplace.visualstudio....items?itemName=ms-vscode.cpptools
(You have to do some extra things if you're not on Ubuntu 14.04, the link above explains those steps near the bottom of the page)

Things I've noticed so far:
Fairly usable watch window.
Reasonably speedy so far
Can execute gdb commands within the vs code console with "-exec <the gdb command>"
No way to jump to other threads and see their callstacks in the gui? I see that there are other expandable items listed in the callstacks panel, but when I try to expand any of them, they're empty. "-exec thread <other thread number>" doesn't help either. Weird.
No assembly view that I can see.

Edited by AndrewJDR on
If you develop on windows and run linux in a VM you can now debug the linux application from Visual Studio it seems:
https://blogs.msdn.microsoft.com/...0/visual-c-for-linux-development/
Linux VM is not prerequisite. It will work also if you use Linux as host and Windows as your VM - which would be more typical if you want hardware GPU acceleration for your target executable.
Debug your Linux programs in a virtual machine running on a Windows machine to debug in visual studio. That doesn't sound like a bodge at all(!)

P.S. I do bodges all the time and would say I am now a master bodger.

P.P.S For non-English people, a bodge is when you do anything to get something working, and it doesn't have to be pretty. E.g. fix your leaky shower with duct tape; fix a loose connection with a weight so that contact is better; strap multiple tools together with string to make a "swiss-army tool". When your bodge fails, you bodge it again until it fails, again.

P.P.P.S I think this may be why software is crap. People think bodging is doing a good job and just bodged it to get out of the door. It works, but not well!
Have you guys heard of voltron? https://github.com/snare/voltron
It's not exactly a debugger but it lets you create views of gdb/lldb/etc. I got sick of having to jump between debuggers all the time because none of them made it easy to just view data. It's not great but at least I can get it to do what I want.
I actually found something the other day that isn't terrible.

https://wiki.gnome.org/Apps/Nemiver/Features

It's just a standalone debugger for linux (no ide bullshit). It's a gdb frontend but actually seems well designed. It's a gnome project so if you aren't using gnome it'll install a bunch of bullshit deps when you apt-get install it (or whatever) but I've been trying it out a bit and it seems pretty good.
Wow, it's actually pretty nice. Much better than anything else I've tried from standalone debuggers. Even allows switching to assembly and stepping through, same as MSVC. It also has tooltips with variable values when hovering above variables.
The dependencies are not so bad, I don't use gnome (I use i3) but it installed only gdl and some GTK dependencies. No gnome libraries. So it's not so bad.
Thanks for posting it!

Edited by Mārtiņš Možeiko on