[all-commits] [llvm/llvm-project] 0205aa: [lldb] Fix member access in GetExpressionPath
Tonko Sabolčec via All-commits
all-commits at lists.llvm.org
Wed Oct 12 05:12:43 PDT 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 0205aa4a02570dfeda5807f66756ebdbb102744b
https://github.com/llvm/llvm-project/commit/0205aa4a02570dfeda5807f66756ebdbb102744b
Author: Tonko Sabolčec <tonkosi123 at gmail.com>
Date: 2022-10-12 (Wed, 12 Oct 2022)
Changed paths:
M lldb/source/Core/ValueObject.cpp
M lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
M lldb/test/API/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
A lldb/test/API/python_api/expression_path/Makefile
A lldb/test/API/python_api/expression_path/TestExpressionPath.py
A lldb/test/API/python_api/expression_path/main.cpp
Log Message:
-----------
[lldb] Fix member access in GetExpressionPath
This change fixes two issues in ValueObject::GetExpressionPath method:
1. Accessing members of struct references used to produce expression
paths such as "str.&str.member" (instead of the expected
"str.member"). This is fixed by assigning the flag tha the child
value is a dereference when calling Dereference() on references
and adjusting logic in expression path creation.
2. If the parent of member access is dereference, the produced
expression path was "*(ptr).member". This is incorrect, since it
dereferences the member instead of the pointer. This is fixed by
wrapping dereference expression into parenthesis, resulting with
"(*ptr).member".
Reviewed By: werat, clayborg
Differential Revision: https://reviews.llvm.org/D132734
More information about the All-commits
mailing list