[Lldb-commits] [PATCH] D61183: PostfixExpression: Introduce CFANode

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 26 04:44:19 PDT 2019


labath created this revision.
labath added reviewers: amccarth, clayborg, aleksandr.urakov.
Herald added a subscriber: aprantl.

This node represents the "Canonical Frame Address" of the current frame,
and is used by various DWARF expressions to express adresses of various
objects relative to the frame.

The motivation for this is the ability to translate breakpad register
unwind rules (strings like: ".cfa 8 - ^") back into dwarf.

This patch introduces the new node type, and teaches the dwarf codegen
how to handle it. A slight complication here is that the value of CFA is
provided differently depending on the context where the dwarf expression
is used. In unwind rules, it is made available implicitly via the
initial dwarf stack. It variable location expressions, it needs to be
referred to explicitly via a special opcode.

As currently, the only usage of this is in the unwind rules, I made the
dwarf generator use this convention, but this can be easily made
configurable, if necessary. The implementation does this via keeping
track of the DWARF stack depth an any given point, and then copying the
CFA value from the bottom of the stack via the DW_OP_pick opcode. This
could be made more efficient for simple expressions, but here I chose to
start with the most general implementation possible.


https://reviews.llvm.org/D61183

Files:
  include/lldb/Symbol/PostfixExpression.h
  source/Symbol/PostfixExpression.cpp
  unittests/Symbol/PostfixExpressionTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61183.196834.patch
Type: text/x-patch
Size: 5452 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190426/05508a95/attachment-0001.bin>


More information about the lldb-commits mailing list