clang++ r235810: gdb doesn't enter some C++ functions, libcxx-pretty-printers don't work, misses signed/unsigned comparisons, etc etc

I noticed that clang++ produces code in which gdb doesn't enter some functions, when clang-3.4.1 didn't have such problem. All compiled with -g, and no -O options

Additionally, STL containers aren't printed with pretty-printers. Is this not the right git repository location https://github.com/koutheir/libcxx-pretty-printers ?

gcc compiled code is free of both problems.

Additionally, gcc found the problem of signed vs. unsigned comparison:
int i;
vector<...> v;
if (i >= v.size()) // <==== **** Here gcc finds the problem, and clang doesn't, as I think it should

Also, gcc found that 'memcpy' not defined (#include <string.h> was really missing). Same with 'close' function and missing header unistd.h. I doubt that headers change depending on compiler. Not sure what to think here, but g++ seems to be more right than clang++.

gdb-7.8.2, FreeBSD 10.1
plain C++ code, compiler with -Wall -g -std=c++11 and linked with -g

BTW, a long while ago I reported the bug that llvm produces clearly wrong debug info, with a very short and particular test case, and you just never fixed this, in "no comment" style. This debug info problem here with C++ might be directly related to that.

Yuri

There was a discussion about the LLVM pretty-printers, the problem was the GPL license.

The headers do change based on the compiler. GCC includes its own modified versions of the system headers. This causes a lot of problems to people running -CURRENT, as the ‘fixed’ headers that GCC includes need regenerating periodically. Clang just uses the system headers.

David

I noticed that clang++ produces code in which gdb doesn’t enter some
functions, when clang-3.4.1 didn’t have such problem. All compiled with -g,
and no -O options

Could you provide a/some concrete example(s)? (preferably small/standalone examples (no header inclusions, etc))

Additionally, STL containers aren’t printed with pretty-printers. Is this
not the right git repository location
https://github.com/koutheir/libcxx-pretty-printers ?

gcc compiled code is free of both problems.

Additionally, gcc found the problem of signed vs. unsigned comparison:
int i;
vector<…> v;
if (i >= v.size()) // <==== **** Here gcc finds the problem, and clang
doesn’t, as I think it should

Seems to warn, if you turn on the -Wsign-comparison:

vec.cpp:4:12: warning: comparison of integers of different signs: ‘int’ and ‘size_type’ (aka ‘unsigned long’) [-Wsign-compare]
return i < v.size();
~ ^ ~~~~~~~~

Also, gcc found that ‘memcpy’ not defined (#include <string.h> was really
missing). Same with ‘close’ function and missing header unistd.h. I doubt
that headers change depending on compiler. Not sure what to think here, but
g++ seems to be more right than clang++.

gdb-7.8.2, FreeBSD 10.1
plain C++ code, compiler with -Wall -g -std=c++11 and linked with -g

BTW, a long while ago I reported the bug that llvm produces clearly wrong
debug info, with a very short and particular test case, and you just never
fixed this, in “no comment” style.

Got a pointer to the bug number?