Add offsetof support to expression evaluator.
authorRaphael Isemann <teemperor@gmail.com>
Thu, 18 Jul 2019 17:58:04 +0000 (17:58 +0000)
committerRaphael Isemann <teemperor@gmail.com>
Thu, 18 Jul 2019 17:58:04 +0000 (17:58 +0000)
commite21fc8770ca4900c131f51a749dac480006d6591
tree6bf54a7c1e78378dd70bcf75edbfa566e2c0fa04
parent801fa8e6b9eb2398a051752bb0e9d81279360d14
Add offsetof support to expression evaluator.

Summary:
We currently don't support offsetof in the expression evaluator as it is implemented as a macro
(which then calls __builtin_offsetof) in stddef.h. The best solution would be to include that
header (or even better, import Clang's builtin module), but header-parsing and
(cross-platform) importing modules is not ready yet.

Until we get this working with modules I would say we add the macro to our existing macro list
as we already do with other macros from stddef.h/stdint.h. We should be able to drop all of them
once we can import the relevant modules by default.

rdar://26040641

Reviewers: shafik, davide

Reviewed By: davide

Subscribers: clayborg, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D64917

llvm-svn: 366476
lldb/packages/Python/lldbsuite/test/lang/c/offsetof/Makefile [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/lang/c/offsetof/TestOffsetof.py [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/lang/c/offsetof/main.c [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/lang/cpp/offsetof/Makefile [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/lang/cpp/offsetof/TestOffsetofCpp.py [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/lang/cpp/offsetof/main.cpp [new file with mode: 0644]
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp