# IDE for C with debugging



## Twister (Jan 10, 2012)

Hello!

Advise please about IDE for C with ability of debugging.
I know about Kdevelop - but it's broken now.


----------



## jrm@ (Jan 10, 2012)

Two options are vi(m) and emacs.  A nice debugger is gdb.  While they may not qualify as IDEs, both are powerful, but require a time investment before you can harness that power.  Search the forum and the web for details.


----------



## gkontos (Jan 10, 2012)

Twister said:
			
		

> Hello!
> 
> Advise please about IDE for C with ability of debugging.
> I know about Kdevelop - but it's broken now.



Why is it broken? I successfully build devel/kdevelop-kde4 just yesterday on a FreeBSD 9.0-STABLE desktop.


----------



## fonz (Jan 10, 2012)

Twister said:
			
		

> Advise please about IDE for C with ability of debugging.


Full-blown IDEs that (as far as I know) support C are Netbeans (requires Java to run) and Eclipse. Both are available in ports somewhere. There may be others, but I wouldn't know because personally I don't like/need an IDE.

Fonz


----------



## Twister (Jan 11, 2012)

Thanks for answers!

I found Anjuta in ports/devel. What's about it? Is it useful?


----------



## fluca1978 (Jan 11, 2012)

I never felt comfortable using eclipse for C development, seems to me the IDE is made for something different. I don't use Anjuta, so I cannot express, I use day by day QtCreator which is more a Qt based IDE than a C++ one and it works quite well. I used kdevelop and it worked fine too. And I use emacs for editing everything when I don't need an IDE.


----------



## Crivens (Jan 11, 2012)

gkontos said:
			
		

> Why is it broken? I successfully build devel/kdevelop-kde4 just yesterday on a FreeBSD 9.0-STABLE desktop.



Well, last time I tried to use it on a sufficiently large source base KDevelop died on the import. Building it does not mean it can do what it is thought of being capable.


----------



## freethread (Jan 11, 2012)

I have not much experience on Unix C/C++ development, however my habit is a bit 'deviated', I feel comfortable with eclipse for debug and for the header indexing to watch/search defines, structs and classes on the fly (most for system headers) and it's multiplatform. I still have to try kdevelop, it should be a good IDE (and java free, nothing bad about java but resource expensive). anjuta... no feeling with automake/autoconf based projects, played a few with it's options but nothing more.


----------



## drhowarddrfine (Jan 11, 2012)

I've been using multiple terms for more than a decade. Nothing's beat it yet.


----------



## expl (Jan 16, 2012)

drhowarddrfine said:
			
		

> I've been using multiple terms for more than a decade. Nothing's beat it yet.



Well once you use IDE wrappers for a month for such functions as compile time error highlighting/shortcuts, debugger shortcuts (breakpoint line set, indicators), links to object declarations/definitions just be clicking on it's name, object index for source files, frontends for revision control systems to indicate changes and possible conflicts on the fly, you will think how much time you would have saved producing code all this time when you were using multiple terminals. There is little wrong with not using an IDE for small projects, but when you dealing with a huge code base and multiple people working together its just a big waste of time using anything else than a properly configured IDE.


----------



## fonz (Jan 16, 2012)

expl said:
			
		

> There is little wrong with not using an IDE for small projects, but when you dealing with a huge code base and multiple people working together its just a big waste of time using anything else than a properly configured IDE.


Complete nonsense and totally biased.

Not that there's anything wrong with your preference, but it's exactly that: your preference.

Fonz


----------



## expl (Jan 16, 2012)

It's far from being completely nonsense. Terminal editors and tools have nothing to offer over modern IDEs other than being capable to be executed from shell and over ssh, while IDEs (can take eclipse as example) can provide vim/emacs functionality from plugins and much more since they are actual IDEs and not text editors.


----------



## drhowarddrfine (Jan 16, 2012)

I'd rather use vim and emacs. The only thing an IDE can offer us is better tracking of object files but I'd bet there's a tool to do that and we haven't taken the time to find that. But that's our workflow and we like to do things our way, not the method provided in an IDE.


----------



## vertexSymphony (Jan 17, 2012)

My vote goes for KDevelop... sorry, but I don't feel like reinventing the wheel in the shell and stressing up my tendons in the process.
All the features that simple text editors doesn't have and that @expl mentioned are quite crucial.

But people is different, for sure ... and people is naturally more productive with certain workflows (worse or better? up to the eyes of the people talking about it), as long as it works for them, I guess it's fine.
In my case, I can't imagine myself hardfscking my tendons (I also study piano, so they are already stressed enough so I can't play with my dear tendons) re-typing functionality and reinventing it, when someone already wrote it, made it cute, and provided that in a IDE.

One of the points I like the most is that KDevelop integrates itself quite well with CMake, so I avoid myself all of the ugliness of Makefiles and I have a portable, efficient and easy to maintain build system.
That if we consider also the powerful parsing capabilities, integrated documentation and such.

Regards, Alex.


----------



## vermaden (Jan 17, 2012)

@Twister

How about GEANY? Its very light and fast.

http://www.geany.org/Documentation/Screenshots


----------



## Crivens (Jan 17, 2012)

There is a thing like the right tool for the right job, so let's say each to his own, let's agree to disagree, shall we?

KDevelop may be a great tool, but I must say it failed me here. When you have a source base of >1GB and a lot of teams working on it, merging in things from other contributors, ... you end up with N local definitions of some classes and you really _need_ some clever thing to find out what the variable is you are currently looking at. Is there some command line tool for that, which works on such a large base and does not scan it repeatedly when I want to know who is calling this method or where the definition for this class is?


----------



## fonz (Jan 18, 2012)

Crivens said:
			
		

> There is a thing like the right tool for the right job, so let's say each to his own, let's agree to disagree, shall we?


My point exactly, thank you very much.

Besides, the OP specifically asked about an IDE and has been given some suggestions. The rest is pure thread hijacking. And I do not think I'm wasting my time while coding, like somebody felt compelled to claim earlier in this thread. On the contrary.

Fonz


----------



## xibo (Jan 18, 2012)

There's also CodeBlocks, but I personally prefer kdevelop over it.


----------



## vand777 (Jan 18, 2012)

My friend uses Visual Studio for code writing (but, of course, not for compiling or debugging). 

He downloaded all headers, setup properly all the Include directories and enjoys MSVS with its IntelliSense, Visual Assist and other cool features and plugins. I'm planning to try the same. 

Re the topic, I prefer devel/kdevelop-kde4. 

P.S. Sorry for the off-topic.


----------



## drhowarddrfine (Jan 18, 2012)

vand777 said:
			
		

> My friend uses Visual Studio
> 
> P.S. Sorry for the off-topic.



Yes. Talk about off-topic...


----------



## vand777 (Jan 18, 2012)

drhowarddrfine said:
			
		

> Yes. Talk about off-topic...



In my previous post I meant that my friend uses MSVS for writing programs for FreeBSD/Linux because MSVS provides a lot of nice features which quicken the code writing process (talking from my personal experience). 

I know that this is not what the topic starter was asking for but it still might be interesting information for those who haven't yet decided on IDE. You never know - maybe MSVS + GDB or MSVS + WinGDB will become a perfect match for someone.


----------



## fnucc (Jan 18, 2012)

I'd throw in Codelite. I downloaded it yesterday and it seems like a simple and nice IDE. Of course, there's some serious programming to be done before the final verdict, but for the start it looks OK.


----------



## drhowarddrfine (Jan 18, 2012)

@vand777 - How is he using VS on FreeBSD? How is making that work with intellisense? And then compiling with gcc and all that to boot? Doesn't make sense to me.


----------



## vand777 (Jan 18, 2012)

drhowarddrfine said:
			
		

> @vand777 - How is he using VS on FreeBSD? How is making that work with intellisense? And then compiling with gcc and all that to boot? Doesn't make sense to me.



As far as I understood him (we just briefly touched the subject), he only writes code in MSVS (he downloaded all system headers to his Windows machine and setup properly Include directories in the MSVS settings), then moves source code to FreeBSD (for example, commits to SVN), then compiles code into native FreeBSD app on FreeBSD machine, tests it.

Also he uses CI server to run unit tests on each commit and integrations tests during the nightly build.


----------



## vand777 (Jan 18, 2012)

He also mentioned WinGDB to me. Do not know the details yet but planning to experiment by myself.

WinGDB's webpage says:

*Features:*

An Add-In for the Visual Studio IDE providing integration with the VS debugger interface.
Support for the GDB debugger as a backend (support for other debuggers is planned for the future).
Remote Linux debugging through SSH connection.
Indirect Linux debugging through SSH connection with gdbserver.
MinGW and Cygwin local debugging.
Embedded Linux systems and OpenOCD/JTAG debugging.
Palm webOS debugging.
Seamless integration with standard Visual Studio projects.
Project configuration wizard.
The "Launch process" command, allowing to start debugging remote or local processes with GDB. The program to debug can be selected using a remote file system browser. Configuration includes, among others: process arguments, environment, working directory, additional source directories, custom initialization scripts.
The "Attach to process" command, allowing attaching to remote or local processes with GDB. The process to attach can be selected using a remote process browser.
The "Examine core dump" command, allowing to examine core dump with GDB.
Mapping source directories allows to map local directories with source code to their remote equivalents.
Remote source code browsing in the Visual Studio editor. The files are fetched as needed using SCP protocol and cached over a session.
Remote creation/edition of the source code in the Visual Studio editor. Edited file is automatically sent back to the target machine after saving it.
Remote build - run make or other build command on remote or local machine. The output of compiler/linker dumps to Visual Studio Console and Tasks windows. User can comfortably navigate between errors and warnings in the source code.
Makefile generator - automatically generates makefiles from Visual Studio projects.
Visualizers (aka "pretty printers" or "auto expanders") allow easy inspection of complex data structures, like STL containers. This feature is based on Python scripting available in GDB 7.0 and higher.
Custom initialization scripts for additional configuration (useful for embedded devices).
User runtime scripts to automate repetitive actions.
Basic debugger commands: Run, Step over/into/out, Break All, Continue, Run to cursor, Set Next Statement.
Breakpoints: setting in remote source files browsed locally. Setting by function name or through call-stack window. Additional breakpoint properties: conditions, hit counting, temporary disabling.
Data breakpoints (write-watchpoints in GDB nomenclature).
Call stack window.
Watch window.
Locals window.
Autos window.
Processes window.
Modules window.
Threads window.
Memory window.
Registers window.
Signals window.
Disassembler view.
Console window for debugged process I/O, emulating a XTerm terminal.
Generating core dump.
Follow fork mode for debugging daemons.
Exceptions.
Support for 64-bit applications.
Byte order support (Big-Endian/Little-Endian).
Controlling GDB Server on embedded Linux systems.
All settings are remembered per Visual Studio project or solution.

From FAQ:



> *What about other Unix systems?*
> When we say "Linux", we think "Linux, or FreeBSD, or OpenSolaris, or OSX, or ...". In general, every platform that GDB and SSH work on, should also work with WinGDB. However, currently available version of WinGDB is being tested only with several popular Linux distros (x86/x86-64), Solaris / OpenSolaris (SPARC/x86/x86-64) and Palm webOS.


----------



## vand777 (Jan 18, 2012)

Please do not think about me as a crazy Windows guy who wants to promote Windows tools in FreeBSD world. I'm not that guy. I do not like Windows. I have to deal with it on a daily basis but I do not like it at all. I love FreeBSD. I'd love to use native, non-Windows tools as much as possible. But I haven't seen IDE for C/C++ as developer-friendly as MSVS is. And if I had chance I'd rather use MSVS than any other IDE with less features and less intelligence.


----------



## freethread (Jan 18, 2012)

I dont' know if VS run on a FreeBSD system without Linux emulation layer, Wine, etc., etc., etc. Strictly speaking, on a pure FreeBSD system there are IDEs in the ports that a (normal/advanced) developer may feel good. I mentioned one that in some way is resonable to fit my needs, but as someone stated, each by its own.
Intellisense is good for 'lazy' .NET developers, however it speed up writing code, but essentially it's used to suggest API/struct/class/etc. names, this is what I mean when talk about code indexing, it's merely an help in remember/search/view code in a quick way and (for me) much more in Unix than Windows. Anyways, Monodevelop should be close to VS, I never used it (I have mono installed and use C# for scripting with cs-script, yes, it works on FreeBSD copying the mono .exe), Eclipse is a 'it make all and nothing' thing and can be configured for what needed, I don't know if NetBeans has C/C++ indexing, for my needs it's good for PHP web development and debugging, KDevelop is on my to-do list but no time to compile KDE dependencies.
Finally, I'm not surprised reading *drhowarddrfine* that only use terminal editors and man pages, it's normal for who knows the system, it's APIs (and data types) and tools (i.e. vim). If I tell you my personal experience with vi (many years ago) you lol for weeks.


----------



## tankist02 (Jan 18, 2012)

+1 for Codelite.


----------



## fluca1978 (Jan 19, 2012)

I use both kdevelop and qtcreator and find them very good. However, since I'm also a Java developer and use Eclipse, I have to say that there is still a gap between such IDE and the latter. Eclipse has so many features for code refactoring and quick help that it kicks the other IDEs. A stupid example: you cna configure both qtcreator and kdevelop to place a closing bracket when you open one. Now eclipse is smart enough to see if, due to a overwriting, there is already a closing bracket and does not place it, the former IDEs do! Another stupid example: when using code assistant to overwrite a property name the property is not overwritten, but just shifted to right and you have to manually delete it.
Anyway, I think Eclipse is not good enough as C/C++ IDE (too complicated to set up) and that KDevelop is the winning one on a day-by-day usage.
This is my opinion.


----------



## throAU (Jan 19, 2012)

There are some things newer IDEs (like Xcode for example) can do that you simply can't do with a couple of xterms.

Like, replace all in scope, tab completion of variable and function names, etc.

If you're productive with  vi/emacs and make, good for you, but there's a whole heap of functionality in modern IDEs that some people would most certainly miss.

As I understand it, CLANG should pave the way for way better open source IDEs.


----------



## vand777 (Jan 19, 2012)

freethread said:
			
		

> I dont' know if VS run on a FreeBSD system without Linux emulation layer, Wine, etc., etc., etc.



He runs it on Windows box.

P.S. Re IDEs, emacs etc, people have preferences and habits. When I had a car with manual gear box 10 years ago, I was always laughing and critisising those who drove on automatic gear box. When I tried it by myself, I became spoiled and now all my cars have it.

I would not be surprised if Doctor will change his mind after he tries MSVS for year or so. Anyway, it sounds like a holy war to me  There are no winners in holy wars


----------



## freethread (Jan 19, 2012)

vand777 said:
			
		

> He runs it on Windows box.



Ah, ok.



			
				vand777 said:
			
		

> P.S. Re IDEs, emacs etc, people have preferences and habits. When I had a car with manual gear box 10 years ago, I was always laughing and critisising those who drove on automatic gear box. When I tried it by myself, I became spoiled and now all my cars have it.
> 
> I would not be surprised if Doctor will change his mind after he tries MSVS for year or so. Anyway, it sounds like a holy war to me  There are no winners in holy wars



I don't think this is a holy war, I see only opinions. Holy wars are wasting of time (and there's no way to see a drop of blood). The thread title is vague eachone ask in a different way, it's useful to learn something new, or at least *Twister* has more informations to play with.


----------



## vand777 (Jan 19, 2012)

Agree.


----------



## drhowarddrfine (Jan 19, 2012)

vand777 said:
			
		

> I would not be surprised if Doctor will change his mind after he tries MSVS for year or so.


I own VS. It was the first thing we got when we got into the web dev business. 

I don't/won't use VS. You NEED it for the tens of thousands of .NET libraries/objects/system calls/etc. or you'd never keep track of them. You do NOT need it for *nix. And it takes almost as long to figure out how to use that as it does emacs. emacs is more flexible. I'd rather use emacs.

In fact, we do!


----------



## vand777 (Jan 20, 2012)

Sorry, Doctor! I was wrong about you 

Anyway, as I mentioned it's all about habits and preferences. People are different. Whatever is good for one person might be unacceptable for another.


----------



## jrm@ (Jan 20, 2012)

throAU said:
			
		

> There are some things newer IDEs (like Xcode for example) can do that you simply can't do with a couple of xterms.
> 
> Like, replace all in scope, tab completion of variable and function names, etc.



No, you can do them all in one xterm: http://youtu.be/OMi-uN-6O1Q.


----------



## fonz (Jan 20, 2012)

vand777 said:
			
		

> Anyway, as I mentioned it's all about habits and preferences. People are different. Whatever is good for one person might be unacceptable for another.


Exactly. What ticked me off was remarks along the line of "not using an IDE is a complete waste of time" and that sort of thing. In fact, I remember a "disagreement" I had with the Doctor some time ago about the exact same thing: whether or not a certain tool is a necessity.

Bottom line is that we all have different ways of doing things. One way is not necessarily better than the other, it depends on personal preference. And the tool that one person can't do without is the same tool that another person needs as much as a toothache.

Live and let live (or die). If you are very happy with a certain tool, good for you. But don't try to tell me that someone else *has* to use the same tool in order to be taken seriously.

Fonz


----------



## drhowarddrfine (Jan 21, 2012)

fonz said:
			
		

> I remember a "disagreement" I had with the Doctor some time ago about the exact same thing



I don't remember any such disagreement. I'm sure it was something you said that was stupid. ==devilish grin==


----------



## fonz (Jan 21, 2012)

drhowarddrfine said:
			
		

> I don't remember any such disagreement. I'm sure it was something you said that was stupid. ==devilish grin==


Saying something stupid? Me? I'd never! :e


----------

