[lldb-dev] invalid use of 'this' outside of a non-static member function

mobi phil mobi at mobiphil.com
Wed Jan 7 11:48:47 PST 2015

> All expressions are compiled in C++ mode and thus the restriction.
> There are a few solutions:
> 1 - make expressions match the current language of the current frame. So
> if your function was a C function, you will be restricted from using C++ in
> your expression
> 2 - rename your "this" and benefit from the C++ abilities of the
> expression parser
> I personally really like the ability to use "auto" and all of the C++11
> constructs in any expression:
> (lldb) expr for (auto x = 0; x < my_renamed_this; ++x) { ... }
> So I see the problem with C expressions, but I would rather not limit you
> from being able to access your C++ code from a C function by limiting the
> language based on where you are stopped.

Thanks, but was not ware how do you switch the current language of the
current frame
that is fine, though at the point where the keyword this is tested, a
simple ( and frame.language != "C"  ) could be implemented, or?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150107/d255e21a/attachment.html>

More information about the lldb-dev mailing list