public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/101643] New: [debug, ada] packed array not described as packed Date: Tue, 27 Jul 2021 14:15:03 +0000 [thread overview] Message-ID: <bug-101643-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101643 Bug ID: 101643 Summary: [debug, ada] packed array not described as packed Product: gcc Version: 7.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: vries at gcc dot gnu.org Target Milestone: --- [ Filing FTR. ] Consider gdb test-case foo_ra24_010.adb / pck.adb / pck.ads ( https://sourceware.org/git/?p=binutils-gdb.git;a=tree;f=gdb/testsuite/gdb.ada/big_packed_array ). With gcc-8.5.0 we have: ... $ gnatmake-8 -f foo_ra24_010.adb -fgnat-encodings=minimal -g $ gdb -q -batch ./foo_ra24_010 -ex start -ex n -ex n -ex 'p bad' Temporary breakpoint 1 at 0x402ce6: file foo_ra24_010.adb, line 19. Temporary breakpoint 1, foo_ra24_010 () at foo_ra24_010.adb:19 19 Good : PA := (others => False); 20 Bad : Bad_Packed_Table := (others => False); 22 Do_Nothing (Good'Address); -- STOP $1 = (0 => 0 <repeats 25 times>) ... while with gcc-9.3.1 we have: ... $ gnatmake-9 -f foo_ra24_010.adb -fgnat-encodings=minimal -g + gdb -q -batch ./foo_ra24_010 -ex start -ex n -ex n -ex 'p bad' Temporary breakpoint 1 at 0x402d24: file foo_ra24_010.adb, line 19. Temporary breakpoint 1, foo_ra24_010 () at foo_ra24_010.adb:19 19 Good : PA := (others => False); 20 Bad : Bad_Packed_Table := (others => False); 22 Do_Nothing (Good'Address); -- STOP $1 = (false <repeats 196 times>) ... The difference in gdb behaviour is caused by the dwarf information. With gcc-8.5.0 we have: ... <2><2074>: Abbrev Number: 10 (DW_TAG_variable) <2075> DW_AT_name : bad <207c> DW_AT_type : <0x2028> <1><2028>: Abbrev Number: 5 (DW_TAG_array_type) <2029> DW_AT_name : pck__t <202d> DW_AT_bit_stride : 8 <202e> DW_AT_type : <0x2003> <2032> DW_AT_alignment : 1 <2033> DW_AT_sibling : <0x203f> <2><2037>: Abbrev Number: 7 (DW_TAG_subrange_type) <2038> DW_AT_type : <0x200a> <203c> DW_AT_lower_bound : 0 <203d> DW_AT_upper_bound : 24 <2><203e>: Abbrev Number: 0 <1><2003>: Abbrev Number: 4 (DW_TAG_base_type) <2004> DW_AT_byte_size : 1 <2005> DW_AT_encoding : 7 (unsigned) <2006> DW_AT_name : system__unsigned_types__packed_byte <1><200a>: Abbrev Number: 4 (DW_TAG_base_type) <200b> DW_AT_byte_size : 4 <200c> DW_AT_encoding : 5 (signed) <200d> DW_AT_name : integer ... With gcc-9.3.1 we have for foo_ra24_010.adb: ... <2><20a1>: Abbrev Number: 11 (DW_TAG_variable) <20a2> DW_AT_name : bad <20a9> DW_AT_type : <0x205f> <1><205f>: Abbrev Number: 7 (DW_TAG_typedef) <2060> DW_AT_name : pck__bad_packed_table <2067> DW_AT_type : <0x2048> <206b> DW_AT_alignment : 1 <1><2048>: Abbrev Number: 5 (DW_TAG_array_type) <2049> DW_AT_name : pck__t___XP1 <204d> DW_AT_bit_stride : 8 <204e> DW_AT_type : <0x2016> <2052> DW_AT_alignment : 1 <2><2057>: Abbrev Number: 8 (DW_TAG_subrange_type) <2058> DW_AT_type : <0x201d> <205c> DW_AT_lower_bound : 0 <205d> DW_AT_upper_bound : 24 <2><205e>: Abbrev Number: 0 <1><2016>: Abbrev Number: 4 (DW_TAG_base_type) <2017> DW_AT_byte_size : 1 <2018> DW_AT_encoding : 7 (unsigned) <2019> DW_AT_name : system__unsigned_types__packed_byte <1><201d>: Abbrev Number: 4 (DW_TAG_base_type) <201e> DW_AT_byte_size : 4 <201f> DW_AT_encoding : 5 (signed) <2020> DW_AT_name : integer ... and with pck__t___XP1 listed once more for pck.adb as: ... <1><1ab5>: Abbrev Number: 5 (DW_TAG_array_type) <1ab6> DW_AT_name : pck__t___XP1 <1aba> DW_AT_bit_stride : 1 <1abb> DW_AT_type : <0x1aa0> <1abf> DW_AT_alignment : 1 <2><1ac4>: Abbrev Number: 6 (DW_TAG_subrange_type) <1ac5> DW_AT_type : <0x15f9> <1ac9> DW_AT_lower_bound : 0 <1aca> DW_AT_upper_bound : 195 <2><1acb>: Abbrev Number: 0 <1><1aa0>: Abbrev Number: 4 (DW_TAG_base_type) <1aa1> DW_AT_byte_size : 1 <1aa2> DW_AT_encoding : 2 (boolean) <1aa3> DW_AT_name : boolean <1><15f9>: Abbrev Number: 2 (DW_TAG_enumeration_type) <15fa> DW_AT_name : pck__enum_idx <15fe> DW_AT_encoding : 7 (unsigned) <15ff> DW_AT_byte_size : 1 ... ISTM that in the gcc-8.5.0 case, gdb does the best it can do with the info provided, and that is this a gcc bug.
next reply other threads:[~2021-07-27 14:15 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-07-27 14:15 vries at gcc dot gnu.org [this message] 2021-07-27 14:17 ` [Bug debug/101643] " vries at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-101643-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).