New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DebugInfo] Support for non-contiguous assumed shape array #926
Closed
Commits on Nov 18, 2020
-
flang gen-exec doesnt show assumed shape array in debugger
Note: This modification makes use of recent upgrade to DISubrange https://reviews.llvm.org/rGd20bf5a7258d4b6a7f017a81b125275dac1aa166 Currently flang generates 0 sized DISubrange metadata for assumed sahpe arrays. --------- test case --------- subroutine sub(assume,n1,n2) dimension assume(n1,n2) end subroutine sub ------- LLVM IR ------- !29 = !DILocalVariable(name: "assume", arg: 1, scope: !26, file: !3, type: !30) !30 = !DICompositeType(tag: DW_TAG_array_type, baseType: !10, size: 32, align: 32, elements: !31) !31 = !{!32, !32} !32 = !DISubrange(count: 0, lowerBound: 1) ------- This is fixed by upgrading DISubrange as it is upgraded in LLVM to be able to dump proper DISubrange for assumed shape array. ------- !29 = !DILocalVariable(name: "assume", arg: 1, scope: !26, file: !3, type: !30) !30 = !DICompositeType(tag: DW_TAG_array_type, baseType: !10, size: 32, align: 32, elements: !31) !31 = !{!32, !36} !32 = !DISubrange(lowerBound: 1, upperBound: !33) !33 = distinct !DILocalVariable(scope: !34, file: !3, type: !35, flags: DIFlagArtificial) !36 = !DISubrange(lowerBound: 1, upperBound: !37) !37 = distinct !DILocalVariable(scope: !34, file: !3, type: !35, flags: DIFlagArtificial) -------
Configuration menu - View commit details
-
Copy full SHA for 6d930b7 - Browse repository at this point
Copy the full SHA 6d930b7View commit details -
Configuration menu - View commit details
-
Copy full SHA for ae08c5f - Browse repository at this point
Copy the full SHA ae08c5fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7eaf80b - Browse repository at this point
Copy the full SHA 7eaf80bView commit details -
[DebugInfo] flang gen-exec does not print pointer/allocatable array i…
…n debugger Note: This modification makes use of recent upgrade to DISubrange https://reviews.llvm.org/rGd20bf5a7258d4b6a7f017a81b125275dac1aa166 Now, below testcase gives desired results with debugger. -------------- program main integer, allocatable :: arr(:) allocate (arr(2:10)) arr(3) = 9 end program main -------------- (gdb) pt arr type = integer (2:10) (gdb) p arr $1 = (0, 9, 0, 0, 0, 0, 0, 0, 0) -------------- And below case works as well -------------- program main type dt integer :: var1 integer :: var2 integer, allocatable :: arr1 (:,:) integer :: var3 end type dt type(dt) :: dvar1 dvar1%var1 = 21 dvar1%var2 = 22 dvar1%var3 = 23 allocate (dvar1%arr1(2:9, 3:11)) dvar1%arr1(5,4) = 11 end program main -------------- (gdb) pt dvar1 type = Type dt integer :: var1 integer :: var2 integer :: arr1(2:9,3:11) integer :: var3 End Type dt (gdb) p dvar1%arr1 $2 = (( 0, 0, 0, 0, 0, 0, 0, 0) ( 0, 0, 0, 11, 0, 0, 0, 0) ( 0, 0, 0, 0, 0, 0, 0, 0) ( 0, 0, 0, 0, 0, 0, 0, 0) ( 0, 0, 0, 0, 0, 0, 0, 0) ( 0, 0, 0, 0, 0, 0, 0, 0) ( 0, 0, 0, 0, 0, 0, 0, 0) ( 0, 0, 0, 0, 0, 0, 0, 0) ( 0, 0, 0, 0, 0, 0, 0, 0) ) ---------------
Configuration menu - View commit details
-
Copy full SHA for 7ccd2a9 - Browse repository at this point
Copy the full SHA 7ccd2a9View commit details -
flang gen-exec does not generate DW_AT_associated or DW_AT_allocated
This patch makes use of commited llvm patch [DebugInfo] Support for DW_AT_associated and DW_AT_allocated. https://reviews.llvm.org/rG2d10258a31a6d05368dfd4442c4aaa7b54614f1e This fix is needed for allocatable/pointer arrays. for pointer array (before allocation/association) Before fix ------ (gdb) pt ptr type = integer (140737345375288:140737354129776) (gdb) p ptr value requires 35017956 bytes, which is more than max-value-size ------ After fix ------ (gdb) pt ptr type = integer (:) (gdb) p ptr $1 = <not associated> ------ for allocatable array (before allocation) Before fix ------ (gdb) pt arr type = integer (140737345375288:140737354129776) (gdb) p arr value requires 35017956 bytes, which is more than max-value-size ------ After fix ------ (gdb) pt arr type = integer, allocatable (:) (gdb) p arr $1 = <not allocated> ------ Testing: - check-flang
Configuration menu - View commit details
-
Copy full SHA for c37f299 - Browse repository at this point
Copy the full SHA c37f299View commit details -
Configuration menu - View commit details
-
Copy full SHA for 53eaeb3 - Browse repository at this point
Copy the full SHA 53eaeb3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1768076 - Browse repository at this point
Copy the full SHA 1768076View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.