Debugging C++ in (Neo)vim - c++

I just switched from windows 10 to arch linux
I want to use (Neo)Vim as my code editor
I've sitted up autocomplition
and Fuzzy finder
But I have no idea how to debug in (Neo)Vim
Any helps!

For neovim there is nvim-dap which is an implementation of the debugging interface called DAP which vscode uses as well. For c/c++ check this page in nvim-dap's wiki.

Until this moment I have just used Neovim/Vim to change some small things in a code on terminal, but I think that installing the Kite plugin can help a little bit while you are coding and also, I found this answer, that has some considerations and possibilities of debuggers for Vim.

If you use gdb, you can use the in-built debugger plugin TermDebug. This works with both Vim and Neovim and is quite nice for C and C++ debugging.

Related

Open source c++ debugger for windows

Does anybody know an open source C++ debugger for Windows?
It doesn't have to be good, it just has to work. (I'd prefer one written in C++)
thanks :)
GDB but ofcourse!
And be assured it works as well as any debugger does :)
In the absence of any statements to the contrary, I'll assume here that gdb will work fine for you. For a comprehensive tool-chain, look to mingw.
Also check out Eclipse CDT (C/C++ Development Tooling) -- this is OPEN SOURCE -- BUT i still doubt it can beat VS 2010 debugger?
Any ideas anyone ?
Technically these both are IDEs, but maybe that's what you mean by debugger. I think you can use whatever compiler/debugger you like with them:
NetBeans- I'm not sure if it will remain open, seeing as Oracle bought Sun Microsystems. It's great as a Java IDE and has C++ modules.
Code::Blocks- I use it on Linux and love it. I can't tell you much about it on Windows though, as I've never used it on that platform. I just know it has an installer.

Suggestion for C IDE?

I used to use gcc compiler on my unix machine. I am now forced to work on a windows machine. Is there any cool IDE or a simple editor for C with a unix terminal like feel (Black Screen and colored syntax on it :))
What other editors/IDE are as robust as gcc for windows? Also what is your personal favorite. I would like a try a few of the those before I stick with one.
Thanks.
Visual Studio. You can change the fonts & colors however you want. I have been using the same coloring scheme since Borland Turbo C++ back in the 80's -- yellow text on a dark blue background.
VIM or Emacs. Though I personally will never use anything other than VS :)
Cygwin is your friend. It gives you all the nice unixy stuff that you miss! :)
In terms of cool IDEs that will integrate nicely with gcc on Cygwin, you should try Netbeans, Eclipse (with CDT) - both require a decent JVM. If you do get Cygwin installed, there's xemacs and gvim I believe that you can get for it...
IMHO stick with Netbeans...
Zeus is a very nice programmer's editor. I just love it's Brief keyboard emulation.
IIRC DOS command prompt can change its color. Have you tried Cygwin and MinGW?
mingw is Minimum Gnu for Windows. There are several add on packages to it, but it has gcc and g++. Occasionally there is an issue with some tool not acting exactly right with executables having .exe on their end or / and \\ in output statements, but it's pretty decent. I can't remember, but I think that there may be some reason that you can't run gdb in Windows, but I could be wrong.
You can also get versions of most of the *nix text editors for Windows. gVim is available if you like vi or vim. Versions of vi and vim for the command line are also available, but don't always act right with resized windows. gVim and vim can do syntax highlighting if you tell them to in the configuration file.
The last couple of versions of Windows have had (or been able to freely download and install) PowerShell, which I suggest you get. It is different from a *nix shell in many many ways, but often (not always) you can get away with using it just like a *nix shell. If you use pipes in it you should know that it likes to turn everything into utf-16, though. The main good thing I've found when using it as a better DOS window is that you can resize the window more freely. You can still use old DOS windows, though.
Another alternative is cygwin, which besides just the command line tools, presents more of a *nix environment for your programs. It includes libraries that make things look more like you are running on Linux from your programs' point of view (simulating many Linux system calls, for instance). I used this a long time ago, but it had some pretty severe problems back then. I have heard great things about it since then, but I have not had enough of a reason to try it out again.
If you are used to a Unix-y feel and are looking for a text editor, I'd honestly avoid installing Visual Studio. It's a nice IDE, but it is very heavyweight and perhaps much more than you are asking for. That said, you might of course find that you like it, but be aware that you are potentially looking at a several-hundred-megabytes download, 2 gigs for the full package IIRC.
Netbeans is good too, but fairly heavy, and a little difficult to get set up correctly with C and C++, at least last time I tried. It's a good alternative to VS, though.
I'd go for a more lightweight solution, like Notepad++, vim for Windows, or my personal favourite, Geany - http://www.geany.org/
Getting the black background & colored syntax is possible on basically any advanced text editor/IDE nowadays.
As for the compiler, MinGW is probably your best bet. Or you could nick the compiler & toolset that comes with Visual Studio Express :)
Visual Studio will be your best bet. Others have mentioned the free Express version which will probably be sufficient for your needs. Visual Studio is not only an IDE, it has Microsoft's compiler bundled with it. Since the choice of IDEs is vast, I'll leave it to you to choose the one you'll be comfortable with.
The venerable GNU gcc compiler is also available on Windows using Cygwin or MinGW.
If you want something pretty cutting edge, compiler wise, you should check out clang. For various reasons, this is the C compiler to keep your eyes on. It's relatively new and was built with IDE support in mind.
When visual studio already being mentioned, I have to mention Slickedit, not a IDE but a fantastic editor.
http://www.slickedit.com
I recommend codelite - cross platform, free IDE designed for GNU toolchain.
Visual Studio 2010 has an express edition that's doanloadable for free.
link text
gcc via Cygwin is another awesome choice esp. if you want to use Emacs as your IDElink text.
Personally, I tend to use both. I heavily lean towards Visual Studio 2010, but occasionally compile using gcc to make sure that both compilers are working the same way. This used to be beneficial in the past (pre VS2010), but I haven't had much success in catching VS2010 make mistakes - yet.
In terms of the overall experience of integrated development, debugging etc., it's hard to beat VS2010.
Net beans
Code block
Dev c++
code lite are good IDE

Searching good Debugger for C++

i was wondering if there was a good debugger you can recommend for C++.
thanks for helping
Whats wrong with Visual studio unless you use linux.
ANyway my suggestion is Visual studio.
But this also depends on what sort of a c++ project you work with.
General answer: use whatever debugger comes with your IDE - something that knows about your project structure will help you immensely when navigating, setting breakpoints, inspecting variables, evaluating expressions, and possibly offering features like edit-and-continue instead of forcing a recompile. Personally, I find Visual Studio to have a pretty darn decent debugger.
If you don't use an IDE, your options are limited... especially if you want symbolic debugging. Your options will pretty much boil down to GDB (with or without frontends), or WinDBG on Windows.
i recommend emacs + gdb. best combination ever.
http://www.cs.cmu.edu/~gilpin/tutorial/
You basically have two choices :
the visual studio debugger if you're under Visual (just press F5)
GDB, and its various user interfaces (this goes from a harsh Emacs mode to QtCreator integration
For Linux you could also try Zero.
Intel has a debugger called idb which is nice and works rather well.
code blocks
Code::Blocks is a free C, C++ and Fortran IDE built to meet the most demanding needs of its users. It is designed to be very extensible and fully configurable.
Finally, an IDE with all the features you need, having a consistent look, feel and operation across platforms.
Built around a plugin framework, Code::Blocks can be extended with plugins. Any kind of functionality can be added by installing/coding a plugin. For instance, compiling and debugging functionality is already provided by plugins!
Special credits go to darmar for his great work on the FortranProject plugin, bundled since release 13.12.
We hope you enjoy using Code::Blocks!

Good C++ Debugging/IDE Environment for Linux?

I have a friend who is trying to make the switch to Linux, but is hung up on the apparent lack of debugging/IDE environments for C++, especially as they relate to template programming. He has been using visual studio for years and is maybe a little spoiled by their awesome IDE. Does anyone have any good suggestions for an environment where he can, under Linux, develop and debug with all of the usual things (Breakpoints, line highlighting for compilation errors, step in/over/out/etc, etc) that he's accustomed to? Thanks!
How about Eclipse + CDT ?
Although many people think of it as a Java IDE, he could try NetBeans. I've used it on Windows for C and C++ development without a problem, and I know NetBeans is supported on Linux, so it would be worth a shot.
It looks like most of the features he wants are included in the C/C++ development toolkit, including integration with GDB, a profiler, and more.
Visual Studio is good, indeed.
On the free side:
Qt Creator is getting quite good too, it's worth a try. There are advantageous by-products coming from the Qt framework:
huge library - not only to build GUI applications but for other domains as well
portability on multiple platforms
A version 1.3 beta is available as a preview of the upcoming release but the current 1.2.1 is already all you need to manage projects.
Eclipse has already been mentioned, it's a very good environment offering many plug-ins (Mylyn, SVN, ...).
MonoDevelop somewhat supports C++ (more and more, I didn't check the latest version).
I've used Eclipse for C/C++ and it's pretty useful. It's also used at ACM ICPC World Finals http://cm.baylor.edu/welcome.icpc
I'd recommand Code::Blocks (but use a nighty build). It can be coupled with gdb to enable step by step debugging and all that stuff.
Not exactly an IDE but SublimeText 2/3 is available on Linux now. There may be a debugger plugin for it too, who knows.
Edit
Here's a gdb plugin for SublimeText
I havn't explored it personally, but Emacs has a C++ development addon that looks very much like a full IDE.
About 7 years ago I used KDevelop that was shipped with KDE. I found it quite good back than, and I hope it also improved with the time. I found it quite comparable to VC++ 6 at this time.
It also contains Qt support, if you are in need for some GUI toolkit.
Depends, Code::Blocks is good, Eclipse is very nice too, but you will need a very good computer. In my opinion the best choice iss gcc, gdb and ViM or Gedit.
My buddies from work use Eclipse + Scons, they also use Valgrind(spelling?) for tracking memory leaks and such.
Many of the IDE features you listed were debugger features. The ddd (Data Display Debugger) debugger is quite a nice GUI wrapper for gdb, allowing graphical representation of data structures, a non-crappy source listing window (ie. unlike the l command of gdb where you don't get context), and also allows you to use any and all native gdb commands directly if desired.
Have a look at CodeLite. It's available for Ubuntu and Fedora out of the box and even for Windows and Mac. So you can have the same IDE on different platforms.
We tried Eclipse and NetBeans but left them due to their huge CPU and memory usage. We have a development server and all the developers connect to it via RDC. Thats why these IDEs miserably failed in our model.
So, we looked for some native IDE. Found CodeBlocks to be very good and super fast. We sort of settled on it but later found CodeLite and liked it better than CodeBlocks.
I just seeing this question after 12+ years. AnyHow I just writing my answer. I personally use Quincy IDE for C and C++ development. it is very lite weight and debugging watch list is very much good and easy to use. I'm just attaching the link to the site. try it.
But you have to install it with wine.
Quincy <-- Click here

Linux C++ Debugger

I'm looking for the perfect Linux C++ debugger. I don't expect success, but the search should be informative.
I am a quite capable gdb user but STL and Boost easily crush my debugging skills. It not that I can't get into the internals of a data structure, it's that it takes so long I usually find another way( "when in doubt, print it out" ).
The macro language for gdb is weird and not very adaptive. Just look at the code for the stanford gdb utils to print out stl structures.
In short I'm unhappy with what I've got.
I recently stumbled upon Zero Bugs. It looks like a silver bullet. What do the current Zero Bugs users think of it?
Has anyone found other good solutions to the Linux C++ Debugger problem?
A development branch of gdb (part of gdb's Project Archer) adds Python support to gdb (to replace gdb's macros). There's a series of blog postings starting here that extensively covers getting started with Python-enabled gdb and offers several tutorials on using Python for defining new gdb commands and pretty printing of C++ data structures.
UndoDB is amazing if you don't mind paying for it. The reversible capability is much much faster than GDB's. http://www.undo-software.com/
There are simple scripts which let you dump STL structures from GDB.
Take a look here
You can try NetBeans IDE 6.5 with gdb 6.8, it is quite powerful!
http://www.netbeans.org/downloads/index.html
ddd (data display debugger)is quite good.....it is basically a visual gdb....
I use the following environment:
http://ec-lang.org/
It is a complete development environment for the eC language.
However, you can have a project with just c or c++ files without any eC specific files and build and debug them using the IDE.
This is the closest you will ever come to a "Borland C" like experience under linux.
It can be installed on Ubuntu/Debian with the following command:
sudo apt-get install ecere-sdk
Recentg gdb (e.g. version 8.1) and g++ (e.g. GCC 7, in february 2018) are able to debug standard C++ containers thru Python scripts.
I haven't done C++ development in Linux for a while now but when I did I had good luck when KDevelop's debugger. Nothing revolutionary but it let you quickly explore object properties like you are looking for.
Try ddd.
You can use Eclipse to step through C and C++ code if you are looking for an IDE type of debugger instead of a command-line debugger. It isn't perfect, but I've found it to work well for people already familiar with IDE debugging tools.
I am also partial to Valgrind for detecting memory errors.