AFAIK Clang and GCC are now roughly neck-and-neck in terms of performance though (at least as of December) - http://www.phoronix.com/scan.php?page=article&item=llvm34_gc...
AFAIK Clang and GCC are now roughly neck-and-neck in terms of performance though (at least as of December) - http://www.phoronix.com/scan.php?page=article&item=llvm34_gc...
Even being able to reliably evaluate C++ expressions is far from what I want: I want to be able to execute arbitrary C++ statements (including loops), use templated objects that weren't instantiated at compile time, etc. I feel like this might be close to possible using, say, the LLVM JIT, although I haven't seen anything that implies anyone is trying to build it.
edit: for example (stock gcc/gdb on Ubuntu 12.04):
#include <iostream>
int main() { std::cout << "foo\n"; }
in gdb, break at main: (gdb) p std::cout << "foo\n"
Cannot resolve function operator<< to any overloaded instance
edit edit: lldb doesn't fare much better (OSX 10.9): (lldb) p std::cout << "foo\n"
error: no member named 'cout' in namespace 'std'
error: 1 errors parsing expression (lldb) expr for (int i=1; i<5; i++) { printf("%d\n", i * i); }
1
4
9
16
It does still fail if the appropriate constructors, templated object instantiations, etc. aren't in the target, as you point out.It still fails on a lot of things for me (including your above example and the std::cout example, although variants work), which I'm guessing (hoping?) is just a lack of maturity. Looking forward to see how it progresses.
At least I'm not aware of being able to type in c/c++ in gdb on the fly like you can with lldb contexts.
So what exactly is "hip and cool" about having your debugger actually use the same parsing engine as the compiler infrastructure? If you have a technical point make it, otherwise stop being the discussion equivalent of acid.