[all-commits] [llvm/llvm-project] 00764c: [lldb] Add support for evaluating expressions in s...

Raphael Isemann via All-commits all-commits at lists.llvm.org
Thu Apr 22 03:15:12 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 00764c36edf88ae9806e8d57a6addb782e6ceae8
      https://github.com/llvm/llvm-project/commit/00764c36edf88ae9806e8d57a6addb782e6ceae8
  Author: Raphael Isemann <teemperor at gmail.com>
  Date:   2021-04-22 (Thu, 22 Apr 2021)

  Changed paths:
    M lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
    M lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h
    M lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
    M lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.h
    M lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
    M lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
    A lldb/test/API/lang/cpp/stopped_in_static_member_function/Makefile
    A lldb/test/API/lang/cpp/stopped_in_static_member_function/TestStoppedInStaticMemberFunction.py
    A lldb/test/API/lang/cpp/stopped_in_static_member_function/main.cpp

  Log Message:
  -----------
  [lldb] Add support for evaluating expressions in static member functions

At the moment the expression parser doesn't support evaluating expressions in
static member functions and just pretends the expression is evaluated within a
non-member function. This causes that all static members are inaccessible when
doing unqualified name lookup.

This patch adds support for evaluating in static member functions. It
essentially just does the same setup as what LLDB is already doing for
non-static member functions (i.e., wrapping the expression in a fake member
function) with the difference that we now mark the wrapping function as static
(to prevent access to non-static members).

Reviewed By: shafik, jarin

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




More information about the All-commits mailing list