Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : Development : Best IDE-based debugger for G++/Linux? (I don't like KDevelop.)
New Topic New Poll Post Reply
Poster Message
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Best IDE-based debugger for G++/Linux? (+1)  
This isn't a DROD question per se, but just a general development question...

I know there are many developers who swear by filling up their code with logging and other instrumentation. I know how to debug with that approach, and do use it to some extent, but I much prefer an IDE-based debugger for most problems. (So please, I don't want to hear the "real programmers use logging" argument.)

Lately, I've done more Linux development and have been using KDevelop as my IDE. The debugger makes calls to GDB. I suspect that GDB is more powerful and less problematic than the KDevelop debugger, but I don't want to drop down to the clunky shell interface to debug. It's an extra context switch between the source code windows I'm already working in, for one thing. The KDevelop IDE apparently has the following debugger shortcomings (correct me if I'm wrong):

* No window for showing the call stack.
* No window for showing views of memory, i.e. a hex view of the address space.
* When stepping through one thread in a process that has multiple threads, the debugger will automatically bring up source code for other executing threads despite the fact I've placed no breakpoints in them.
* No mouseover tooltips to show the value of data in the source code windows.
* Not much support for getting display values from complex types like STL strings (you have to dig down to the member holding the string buffer) or decoding unicode/utf8 strings.
* When an interrupting signal is detected, like SIGABORT or SIGSEV, the source window will not show the line that generated the signal. Much time would be saved in tracking down problems with uncaught exceptions and access violations if it would do this.

Now, the software is free, and I'm not bitching about KDevelop programmers doing a bad job, but I'm still wondering what else is out there that is a better debugging IDE.

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
10-27-2006 at 08:33 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
AlefBet
Level: Smitemaster
Rank Points: 979
Registered: 07-16-2003
IP: Logged
icon Re: Best IDE-based debugger for G++/Linux? (+1)  
Well, I would have suggested KDevelop's debugger but I guess you're already acquainted with that. I personally don't use it, though. I prefer Gnome to KDE (although you can use KDevelop under Gnome if you want to), and I prefer Vim+SCons+Gdb over an IDE (but I do know how attractive IDEs can be to those who use them).

Okay, personal rambling over. You might try "kdbg". I thought KDevelop used it, but I guess not since I know for a fact you can view stack traces in it, and I'm pretty sure you can probe memory in it. (I know you can view arbitrary variables in its watch window, and you can usually use that type of interface to probe pointers by casting a raw address, if push comes to shove.) Can't speak to its threaded debugging capabilities, though, since all my programs tend to be single-threaded.

There are also "ddd" and "xxgdb" which are thinner wrappers around gdb. Gdb is a bit of a wrinkly beast, and these graphical debuggers will do less to hide the wrinkles from you (there's actually a window where you can directly enter gdb commands), but they do give you a graphical interface for watch windows, source-code views, breakpoints, and so on.

Hope this helps.

____________________________
I was charged with conspiracy to commit jay-walking, and accessory to changing lanes without signaling after the fact :blush.

++Adam H. Peterson
10-27-2006 at 10:18 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Re: Best IDE-based debugger for G++/Linux? (0)  
AlefBet wrote:
Well, I would have suggested KDevelop's debugger but I guess you're already acquainted with that. I personally don't use it, though. I prefer Gnome to KDE (although you can use KDevelop under Gnome if you want to), and I prefer Vim+SCons+Gdb over an IDE (but I do know how attractive IDEs can be to those who use them).
Well, I drop down to GDB when I hit a problem KDevelop doesn't debug well, but yeah, it slows me down. I guess it comes down to a matter of preference, and I realize some people prefer sticking to command-line tools.
Okay, personal rambling over. You might try "kdbg". I thought KDevelop used it, but I guess not since I know for a fact you can view stack traces in it, and I'm pretty sure you can probe memory in it. (I know you can view arbitrary variables in its watch window, and you can usually use that type of interface to probe pointers by casting a raw address, if push comes to shove.)
It looks at least like an improvement over the debugger in KDevelop, so I'll give it a try, thanks. Looking at the feature list on the website, I see several of the things I wanted, and generally, the layout is much nicer.
There are also "ddd" and "xxgdb" which are thinner wrappers around gdb.
Good to know about these too.

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
10-28-2006 at 12:51 AM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
halyavin
Level: Delver
Rank Points: 52
Registered: 02-20-2006
IP: Logged
icon Re: Best IDE-based debugger for G++/Linux? (0)  
There is Eclipse+CDT also, but it use gdb (for C/C++ programs), and so buggy as all debuggers which use it. But maybe it contains less annoying bugs.
11-08-2006 at 01:20 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
AlefBet
Level: Smitemaster
Rank Points: 979
Registered: 07-16-2003
IP: Logged
icon Re: Best IDE-based debugger for G++/Linux? (0)  
halyavin wrote:
There is Eclipse+CDT also, but it use gdb (for C/C++ programs), and so buggy as all debuggers which use it. But maybe it contains less annoying bugs.
I don't think anyone was asserting that GDB was buggy, only that it was quirky or hard to learn. Provided it behaves according to spec, any debugger that's layered on top of it could be as benign and easy to use as its developer wants, hiding or exposing the quirks according to how they want it programmed.

____________________________
I was charged with conspiracy to commit jay-walking, and accessory to changing lanes without signaling after the fact :blush.

++Adam H. Peterson
11-08-2006 at 05:32 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Re: Best IDE-based debugger for G++/Linux? (+1)  
AlefBet wrote:
I don't think anyone was asserting that GDB was buggy, only that it was quirky or hard to learn. Provided it behaves according to spec, any debugger that's layered on top of it could be as benign and easy to use as its developer wants, hiding or exposing the quirks according to how they want it programmed.
Yeah, that sums up my current viewpoint of GDB. I also noted that KDevelop debugger didn't expose important parts of GDB's functionality such as describing the call stack.

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
11-08-2006 at 09:09 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged
icon Re: Best IDE-based debugger for G++/Linux? (+1)  
ErikH2000 wrote:
Yeah, that sums up my current viewpoint of GDB. I also noted that KDevelop debugger didn't expose important parts of GDB's functionality such as describing the call stack.
It does, actually. It's available in the 'frame stack' tab at the bottom of the window. You might have to click another tab first to make it show up, though, and sometimes it seems to disappear. It's a bit buggy. There's also a GDB tab you can use to directly interface with gdb, btw.

Anyway, gdb itself is pretty solid in my experience. I had some problems getting it to work with multiple threads once, but that turned out to be caused by the pthread debug library being stripped. Also look out for compiler flags, of course. Use -ggdb, don't use -fomit-frame-pointer, etc.

~ Gerry
11-09-2006 at 01:22 AM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged
icon Re: Best IDE-based debugger for G++/Linux? (0)  
trick wrote:
Anyway, gdb itself is pretty solid in my experience.
...and then, 15 hours later, I get this:
Cannot fetch general-purpose registers for thread 1090525520: generic error
-_-

~ Gerry

[Last edited by trick at 11-09-2006 05:07 PM]
11-09-2006 at 05:07 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
halyavin
Level: Delver
Rank Points: 52
Registered: 02-20-2006
IP: Logged
icon Re: Best IDE-based debugger for G++/Linux? (0)  
Have I said, that it is buggy? And most debuggers which use it even more buggy than that. I think this is also depends on compiler - developers are lazy to support correct debug information: debugger often stops on wrong line in code.
11-15-2006 at 09:54 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged
icon Re: Best IDE-based debugger for G++/Linux? (0)  
halyavin wrote:
Have I said, that it is buggy? And most debuggers which use it even more buggy than that. I think this is also depends on compiler - developers are lazy to support correct debug information: debugger often stops on wrong line in code.
If you're debugging optimized code, that can happen. It's caused by the compiler rearranging bits of code to make it run faster. Statements can be moved around, split, merged, optimized out, etc. If this is a problem, try disabling optimization for your debug builds.

~ Gerry
11-16-2006 at 06:16 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Briareos
Level: Smitemaster
Avatar
Rank Points: 3516
Registered: 08-07-2005
IP: Logged
icon Re: Best IDE-based debugger for G++/Linux? (0)  
halyavin wrote:
There is Eclipse+CDT also, but it use gdb (for C/C++ programs), and so buggy as all debuggers which use it. But maybe it contains less annoying bugs.
Well, I'm currently developing a rather small utility using potrace and found out the hard way that both I and potrace really didn't like MSVC++ 2005 Express Edition.

After having a horrible encounter with MinGW and wxDev-Cpp/DevCpp (which is even more limited than MSVC++2006EE) I thought I might give Eclipse's CDT another try, especially as I have Cygwin installed anyway and last tried CDT years ago.

Well, after working a few (not so) minor kinks concerning DOS/Windows style filenames out of cygwin (which included patching and re-compiling make with a patch that should have been included months ago - but the CDT team could've just used cygwin paths in the makefiles as well...) I got an IDE that I both was rather familiar with (from the Java side) and that had a working debugger. But of course, if you're running it on Linux you won't even have to deal with this.

Features include configurable breakpoints, listing and displaying of variables, classes and structures, displaying and traversing the call stack, examining memory areas, source-level debugging, code disassembly, the whole shebang you expect from an IDE...

So maybe you'd want to give it a try, Erik? :)

np: Underworld - Two Months Off (Underworld 1992-2002 (Disc 2))

____________________________
"I'm not anti-anything, I'm anti-everything, it fits better." - Sole
R.I.P. Robert Feldhoff (1962-2009) :(
11-19-2006 at 09:03 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : Development : Best IDE-based debugger for G++/Linux? (I don't like KDevelop.)
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.