Handmade Hero » Forums » Code » Linux Standalone Debuggers
cmuratori
Casey Muratori
802 posts
1 project

Casey Muratori is a programmer at Molly Rocket on the game 1935 and is the host of the educational programming series Handmade Hero.

#3850 Linux Standalone Debuggers
2 years, 3 months ago

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
andrewjdr
AndrewJDR
21 posts
#3857 Linux Standalone Debuggers
2 years, 3 months ago Edited by AndrewJDR on June 4, 2015, 8:52 p.m.

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.
DomsL
Dominik
10 posts
#4155 Linux Standalone Debuggers
2 years, 2 months ago

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. :)
salty-horse
Ori Avtalion
3 posts
#4156 Linux Standalone Debuggers
2 years, 2 months ago

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.
cmuratori
Casey Muratori
802 posts
1 project

Casey Muratori is a programmer at Molly Rocket on the game 1935 and is the host of the educational programming series Handmade Hero.

#4157 Linux Standalone Debuggers
2 years, 2 months ago

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
DomsL
Dominik
10 posts
#4182 Linux Standalone Debuggers
2 years, 2 months ago

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)
marsol0x
Marshel Helsper
1 posts

None

#4183 Linux Standalone Debuggers
2 years, 2 months ago

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.

None
KareemErgawy
Kareem
7 posts
#5466 Linux Standalone Debuggers
1 year, 9 months ago

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 :).
andrewjdr
AndrewJDR
21 posts
#6277 Linux Standalone Debuggers
1 year, 5 months ago Edited by AndrewJDR on March 31, 2016, 12:09 a.m.

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.
Rooc
Roderic Bos
69 posts
#6304 Linux Standalone Debuggers
1 year, 5 months ago

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/
mmozeiko
Mārtiņš Možeiko
1477 posts
1 project
#6305 Linux Standalone Debuggers
1 year, 5 months ago

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.
gingerBill
Ginger Bill
212 posts
2 projects

I am ginger thus have no soul.

#6328 Linux Standalone Debuggers
1 year, 5 months ago

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!
pluto4890
Edrick Hong Zhi Xuan
1 posts
#6381 Linux Standalone Debuggers
1 year, 5 months ago

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.
steve
Stephen Olsen
19 posts
1 project
Software Engineer from Chicago. Data processing / web infrastructure by day, AI ...
#9056 Linux Standalone Debuggers
11 months ago

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.
mmozeiko
Mārtiņš Možeiko
1477 posts
1 project
#9057 Linux Standalone Debuggers
11 months ago Edited by Mārtiņš Možeiko on Oct. 22, 2016, 7:09 p.m.

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!