[PATCH] D79592: [DebugInfo] support for DW_AT_data_location in llvm
Alok Kumar Sharma via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 7 23:57:32 PDT 2020
alok added a comment.
In D79592#2025853 <https://reviews.llvm.org/D79592#2025853>, @aprantl wrote:
> Why is the data location a part of the type and not something dynamically bound via dbg.value or something similar?
>
> What's an example for what a typical data location expression?
Dynamic arrays are represented by two things
- allocated space
- descriptor which describes the array bounds (always) and allocated space (not always)
DW_AT_location attached to DW_TAG_variable denotes descriptor, which is used by bounds (using DW_OP_push_object_address). Since DW_AT_location denotes descriptor, DW_AT_data_location is used to denote allocated space. DWARF has attached that to DW_TAG_array_type.
In cases when descriptor also has a pointer to allocated space (as in case of gfortran), DW_AT_data_location can also be described by DW_OP_push_object_address and offset where the pointer to allocated space is. In cases when descriptor does not have the pointer to allocated space (as in case of flang), DW_AT_data_location can be represented by DIE reference which denotes an artificial variable which has the data pointer (dbg.declare in IR).
Please let me know if you need more information.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79592/new/
https://reviews.llvm.org/D79592
More information about the llvm-commits
mailing list