[PATCH] D83544: [DebugInfo] Support for DW_AT_associated and DW_AT_allocated.

Alok Kumar Sharma via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 10 04:17:10 PDT 2020


alok created this revision.
alok added reviewers: aprantl, probinson, jmorse, dblaikie, vsk, jini.susan.george, SouraVX.
alok added a project: debug-info.
Herald added subscribers: llvm-commits, ormris, hiraditya.
Herald added a reviewer: sscalpone.
Herald added a reviewer: jdoerfert.
Herald added a project: LLVM.

This support is needed for the Fortran array variables with pointer/allocatable
attribute. This support enables debugger to identify the status of variable
whether that is currently allocated/associated.
for pointer array (before allocation/association)

without DW_AT_associated
------------------------

(gdb) pt ptr
type = integer (140737345375288:140737354129776)
(gdb) p ptr

value requires 35017956 bytes, which is more than max-value-size
----------------------------------------------------------------

with DW_AT_associated
---------------------

(gdb) pt ptr
type = integer (:)
(gdb) p ptr

$1 = <not associated>
---------------------

for allocatable array (before allocation)

without DW_AT_allocated
-----------------------

(gdb) pt arr
type = integer (140737345375288:140737354129776)
(gdb) p arr

value requires 35017956 bytes, which is more than max-value-size
----------------------------------------------------------------

with DW_AT_allocated
--------------------

(gdb) pt arr
type = integer, allocatable (:)
(gdb) p arr

$1 = <not allocated>
--------------------

  Testing

- unit test cases added
- check-llvm
- check-debuginfo


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83544

Files:
  llvm/docs/LangRef.rst
  llvm/include/llvm/IR/DebugInfoMetadata.h
  llvm/lib/AsmParser/LLParser.cpp
  llvm/lib/Bitcode/Reader/MetadataLoader.cpp
  llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
  llvm/lib/IR/AsmWriter.cpp
  llvm/lib/IR/DebugInfoMetadata.cpp
  llvm/lib/IR/LLVMContextImpl.h
  llvm/lib/IR/Verifier.cpp
  llvm/test/Bitcode/allocated.ll
  llvm/test/Bitcode/associated.ll
  llvm/test/DebugInfo/X86/dwarfdump-allocatedExp.ll
  llvm/test/DebugInfo/X86/dwarfdump-allocatedVar.ll
  llvm/test/DebugInfo/X86/dwarfdump-associatedExp.ll
  llvm/test/DebugInfo/X86/dwarfdump-associatedVar.ll
  llvm/test/Verifier/array_allocated.ll
  llvm/test/Verifier/array_associated.ll
  llvm/unittests/IR/DebugTypeODRUniquingTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83544.276980.patch
Type: text/x-patch
Size: 45752 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200710/4b0a3673/attachment-0001.bin>


More information about the llvm-commits mailing list