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

Yuri yuri at rawbw.com
Sat Apr 25 19:16:44 PDT 2015


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



More information about the cfe-dev mailing list