I am developing in C++ on Windows with minGW. I have debugging problems at the moment.
I must use an old version of GCC (4.4). So I was just wondering if it is possible to compile with this old GCC and debug with a new GDB?
What is the link between the two of them?
(Any pointers regarding debugger crashes would be greatly appreciated too! I just know that I need to be sure to use debug DLLs)
gcc is a debugger by GNU project. Gdb can step through your source code line-by-line or even instruction by instruction. You may also watch the value of any variable at run-time. In additon, it also helps to identify the place and the reason making the program crash.
Most programs and libraries are, by default, compiled with debugging symbols included (with gcc option -g).
GDB stands for GNU Project Debugger and is a powerful debugging tool for C(along with other languages like C++). It helps you to poke around inside your C programs while they are executing and also allows you to see what exactly happens when your program crashes.
GDB and GCC are separate programs -- separate source bases (with a bit of shared code, though not much), generally separate maintainers, different release schedules, and different version numbers. They do share a bit of culture and of course there is some coordination.
GDB is reasonably good about backward compatibility. It even keeps workarounds for bugs in debuginfo emitted by older versions of GCC and sometimes other compilers. What this means is that you can usually upgrade GDB while keeping the same GCC version.
The reverse, though, is not always the case. Sometimes a new version of GCC emits debug info that an older GDB cannot understand. In this situation you must upgrade GDB as well. In some limited situations you can pass a compatibility flag to GCC to ask for downgraded debug info, but this isn't always possible. And, since it is simple to upgrade GDB, you might as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With