[all-commits] [llvm/llvm-project] e30c49: [lldb] Support non-pointer implicit this/self in G...

Dave Lee via All-commits all-commits at lists.llvm.org
Wed Jun 15 22:05:21 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e30c493894c410825ad7467f4996aca7f613ce81
  Author: Dave Lee <davelee.com at gmail.com>
  Date:   2022-06-15 (Wed, 15 Jun 2022)

  Changed paths:
    M lldb/source/Target/StackFrame.cpp

  Log Message:
  [lldb] Support non-pointer implicit this/self in GetValueForVariableExpressionPath

The `frame variable` command supports an implicit `this`/`self`, allowing a
user to run `v some_field` instead of `v this->some_field`. However, some
languages have non-pointer `this`/`self` types (for example, Swift).

This change adds support for non-pointer implicit `this`/`self`. This is done
by consulting the type of the instance variable. If the type is known to be
non-pointer, the dot operator is used instead of the arrow operator.

The C language of families each have a pointer instance type, which makes
testing of this difficult. Tests for this feature will be done in the Swift
downstream fork, as Swift's `self` is a non-pointer (reference) type.


Reviewed By: aprantl

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

More information about the All-commits mailing list