-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Open
Labels
Description
#include <iostream>
namespace google {
class LogMessageVoidify {
public:
LogMessageVoidify() { }
// This has to be an operator with a precedence lower than << but
// higher than ?:
void operator&(std::ostream&) { }
};
#define LOG(level) \
!(level) ? (void) 0 : google::LogMessageVoidify() & std::cerr
#define INFO 1
#define DEBUG 0
}
int main() {
LOG(INFO) << "This is an informational message." << std::endl;
return 0;
}
Compile with
clang++ -std=c++17 -pthread -glldb -gdwarf-5 -fno-debug-types-section -gpubnames patatino.cpp -fuse-ld=lld -o pat
llvm-dwarfdump shows two duplicate entries for _ZN6google17LogMessageVoidifyanERSo, one with parent namespace, the other without.
In the debug_names mapping the entry that gets indexed is the one without parent namespace. We believe the entry with parent namespace should be indexed/should have precedence, if possible, so that lldb can walk back the parent chain and perform faster lookups.
(note: we've been seeing on large projects lldb taking 3 minutes to print an expression using the expression evaluator due to this lack of filtering).
Thoughts on this? @JDevlieghere / @adrian-prantl / @dwblaikie