[Bug debug/78375] New: Fortran, pointer to structure, data_member_location
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78375 Bug ID: 78375 Summary: Fortran, pointer to structure, data_member_location Product: gcc Version: 6.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: bernhard.heckel at intel dot com Target Milestone: --- Created attachment 40052 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40052=edit Pointer to struct example According to DWARF4 & 5, DW_AT_data_member_location is referring to the beginning of the containing entity. If a pointer has a target type of a struct, it means the pointer has first to be dereferenced (address of the containing entity) before the location of the member types can be resolved. Fortran specifies pointers but it doesn't specify a dereference operator. Rather then explicitly using a pointer type with a structure as a target type, I suggest to use a structure type with the DW_AT_associated attribute (Pointer attribute) This approach would be similar to how array pointers are implemented at the moment. >From my point of view, DW_AT_associated (pointer) attribute should be preferred over all rather then using pointer types. Advantage I see: - Less debug overhead, just one attribute compared to an additional tag + attributes - Similar approach to example "D.2.4 Fortran Dynamic Type Example" in DWARF 5 - No additional explicit dereferencing needed to get target value I added a small example for the pointer to struct use-case.
[Bug fortran/78059] Pointer to variable length array, debug info
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78059 Bernhard Heckel changed: What|Removed |Added Status|WAITING |RESOLVED Resolution|--- |INVALID --- Comment #7 from Bernhard Heckel --- DWARF 4 & 5 is showing an example of pointer array in fortran. D.2.1 Fortran Simple Array Example Gfortran implements it's description exactly in that way.
[Bug fortran/24546] [meta-bug] gfortran debugging problems
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24546 Bug 24546 depends on bug 78059, which changed state. Bug 78059 Summary: Pointer to variable length array, debug info https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78059 What|Removed |Added Status|WAITING |RESOLVED Resolution|--- |INVALID
[Bug debug/78271] Fortran, additional pointer type for deferred length strings
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78271 --- Comment #1 from Bernhard Heckel --- Created attachment 40003 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40003=edit Debug info Icc
[Bug debug/78271] New: Fortran, additional pointer type for deferred length strings
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78271 Bug ID: 78271 Summary: Fortran, additional pointer type for deferred length strings Product: gcc Version: 6.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: bernhard.heckel at intel dot com Target Milestone: --- Created attachment 40002 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40002=edit Debug info Gfortran Debug info for deferred length strings have additional pointer type, which is wrong in my opinion. Assumed length strings seems to be ok. See attached debug info for variable "vara" and "varb". "varb" has additional pointer attribute. Same to "vare" Fortran reproducer is from here: PR78212 Attached also debug info generated by ICC
[Bug fortran/78059] Pointer to variable length array, debug info
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78059 --- Comment #6 from Bernhard Heckel --- Ping
[Bug fortran/78059] Pointer to variable length array, debug info
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78059 --- Comment #5 from Bernhard Heckel --- Hi Dominique, did my comment help to figure out if the bug report is valid?
[Bug fortran/78059] Pointer to variable length array, debug info
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78059 --- Comment #4 from Bernhard Heckel --- <1>: Abbrev Number: 9 (DW_TAG_array_type) DW_AT_data_location: 2 byte block: 97 6 (DW_OP_push_object_address; DW_OP_deref) DW_AT_associated : 4 byte block: 97 6 30 2e (DW_OP_push_object_address; DW_OP_deref; DW_OP_lit0; DW_OP_ne) DW_AT_type: <0xca> DW_AT_sibling : <0xf5>
[Bug fortran/78059] Pointer to variable length array, debug info
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78059 --- Comment #1 from Bernhard Heckel --- Created attachment 39857 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39857=edit Gfortran debug info
[Bug fortran/78059] Pointer to variable length array, debug info
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78059 --- Comment #2 from Bernhard Heckel --- Created attachment 39858 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39858=edit Expected debug info
[Bug fortran/78059] New: Pointer to variable length array, debug info
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78059 Bug ID: 78059 Summary: Pointer to variable length array, debug info Product: gcc Version: 4.8.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: bernhard.heckel at intel dot com Target Milestone: --- Created attachment 39856 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39856=edit Fortran sample Current behaviour: A pointer to an variable length array (VLA) is declared in the dwarf debug_info as an array with the "associated attribute". Expectation is to see a pointer type which has an array as target type as described here: http://www.j3-fortran.org/doc/year/04/04-007.pdf Glossary of technical terms (Page 425) array pointer (5.1.2.5.3) : A pointer to an array Attached is a - fortran example - Gfortran generated dwarf info - Expected dwarf info
[Bug fortran/71454] [oop] extend type, missing relationship to baseclass in DWARF
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71454 Bernhard Heckel changed: What|Removed |Added Status|WAITING |RESOLVED Resolution|--- |DUPLICATE --- Comment #3 from Bernhard Heckel --- Yes, it is a duplicate. The use-case was exactly: "In this example, x%a and x%t2%a access the component of the parent type" *** This bug has been marked as a duplicate of bug 49475 ***
[Bug fortran/49475] [OOP][debugging] Add DWARF info for Fortran's OOP features (extension, member functions)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49475 Bernhard Heckel changed: What|Removed |Added CC||bernhard.heckel at intel dot com --- Comment #3 from Bernhard Heckel --- *** Bug 71454 has been marked as a duplicate of this bug. ***
[Bug fortran/71454] [oop] extend type, missing relationship to baseclass in DWARF
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71454 --- Comment #1 from Bernhard Heckel --- Created attachment 38661 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38661=edit Type extend, source example
[Bug fortran/71454] New: [oop] extend type, missing relationship to baseclass in DWARF
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71454 Bug ID: 71454 Summary: [oop] extend type, missing relationship to baseclass in DWARF Product: gcc Version: 5.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: bernhard.heckel at intel dot com Target Milestone: --- Created attachment 38660 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38660=edit Dwarf_output Fortran support type extension. When looking into the DWARF output of such a type, there is no relation between extended type and baseclass. The baseclass is handled in DWARF like a struct member of the extended type rather then using DW_TAG_inheritance.