I'm trying to debug a program on a embedded device. The problem is that it uses ARMv5 and valgrind doesn't support that platform (there are some patches over there but I was not able to make it work).
I tried some tools like gdb or memwatch, but it isn't enough to find the leaks.
Anyone could suggest a solution? I thought of maybe some kind of remote debugging or so.
Thanks for your answers
Valgrind is a very powerful tool and it's pretty sad that it does not work on ARMv5 because it makes debugging memory leaks and invalid memory accesses more difficult on this platform.
I see several less powerful options. You can try to enable some additional checks within the C library by setting the MALLOC_CHECK_ environment variable. If your compiler is GCC 4.8 or higher you can try AddressSanitizer (I never used it on ARMv5 though).
Does anyone know of memory debugging tools (like Valgrind) for native C++ code under Android NDK?
We have a project that uses quite a bit of native code. As hinted in one of the comments for the question, the best approach is to test that code on another environment.
We have a separate project that builds in Linux and calls the C/C++ functions we use in our Android code. Once you are at that point, all the nice tools you are used to (gdb, Valgrind, etc.) are available to you.
A lot more productive than doing the same thing on the phone (assuming you could even find a good tool).
The tricky part is to have a good test harness, but that should be a given to any project that started off on the right path... ;)
I develop unmanaged C++ applications in MSVC2008. And occasionally the application crashes at the customer site. I found an article on this. But it was written in 2002 for Visual Studio .NET. Has things changed since? Can the same technique be used? Is there a newer method?
If you are debugging C and C++ apps for Windows, you want to learn how to use WinDBG (distributed as "debugging tools for Windows"). It has a bit of a learning curve, but the documentation is really good and it really is the best the platform has to offer.
As to your question, you can view a crash dump with windbg -z <dump filename>.
Usually release mode binaries (which typically run at customer site) are built with optimization (for speed/memory etc). Troubleshooting optimized binaries is usually not as easy.
So, first check if the crash is reproducible with release mode binaries built without optimization. If yes, then the job is easy (ier).
Here is some info.
Also look at a tool called ADPlus from microsoft
I am verifying an application coded in c++ with memory leak and need a utility (freeware) I can easily run to detect where it is ocurring. any ideas?
On the following platforms,
x86/Linux: support is mature and almost complete.
AMD64/Linux: support is mature and almost complete.
PPC32/Linux: support is new but fairly complete.
PPC64/Linux: support is new but fairly complete.
x86/Darwin (Mac OS X): support is new.
AMD64/Darwin (Mac OS X): not officially supported, but probably works.
I'd recommend Valgrind
If you're using Visual Studio, this link has some info.
If you're using Windows, and not Visual Studio, then this SO page has a lot of suggestions - and then this question should be closed :)
The answer depends on OS you are using. On Windows there is a very good free tool — the user-mode dump heap (UMDH) utility.
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