[an error occurred while processing this directive]
Node:GDB and C++ source,
Next:C++ classes in GDB,
Q: When I try to debug my C++ programs, the debugger claims it can't
find the source file:
file.cc: No such file or directory.
The source file is there, but it's called
file.cc. Why does this happen?
A: It's a bug in GCC 18.104.22.168 and earlier. It erroneously assumes
that a C++ source always has a
.cc extension. If you are using
GCC 22.214.171.124 or earlier, you'd better call your C++ files
If this is unacceptable, you can work around this bug by invoking
cc1plus and the assembler pass manually. The bug in GCC
manifests itself in that
cc1plus is called with the option
-dumpbase file.cc. If you replace this with
-dumpbase file.cpp (or whatever your extension is), the
debugger will happily find your sources.
GCC 2.8.0 and later corrects this bug, so upgrading is also a solution.