public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "simark at simark dot ca" <sourceware-bugzilla@sourceware.org> To: gdb-prs@sourceware.org Subject: [Bug symtab/26813] DW_FORM_rnglistx and DW_FORM_loclistx not fully supported Date: Fri, 30 Oct 2020 19:03:14 +0000 [thread overview] Message-ID: <bug-26813-4717-dkhxb6XvRW@http.sourceware.org/bugzilla/> (raw) In-Reply-To: <bug-26813-4717@http.sourceware.org/bugzilla/> https://sourceware.org/bugzilla/show_bug.cgi?id=26813 --- Comment #6 from Simon Marchi <simark at simark dot ca> --- I'm focusing on rnglists at the moment, but it all probably applies to loclists too. I did the same changes as Zoran to make GDB properly handle the rnglistx form, then hit some more important issues. First, read_rnglist_index returns a CORE_ADDR: that's wrong, because a CORE_ADDR is meant to represent an address in the program. This function returns an offset in the .debug_rnglists section, the beginning of the range list. It should probably be sect_offset. The .debug_rnglists section in the executable I uploaded looks like this: [0x00, 0x0B]: header for CU 1 [0x0C, 0x0F]: list of offsets for CU 1 (1 element) [0x10, 0x78]: range lists data for CU 1 [0x79, 0x84]: header for CU 2 [0x85, 0xB4]: list of offsets for CU 2 (12 elements) [0xB5, 0xBD7]: range lists data for CU 2 The DW_AT_rnglists_base for CU 2 points to 0x85, that is the beginning of the list of offsets for that CU. That's just past the header. The DW_AT_ranges value for CU 2 has value 0xb (11). When read_rnglist_index is called for that index, it reads the header at the beginning of the .debug_rnglists section. That's wrong, because the header at the beginning of the section is the header for CU 1, and we are reading a range list for CU 2. If we wanted to read a header, it should be the header at 0x79. But since the link from CU 2 to the .debug_rnglists is DW_AT_rnglists_base, and it points after its header, I don't think we are expected to read the header to do the index -> range list conversion. Since the header is not of constant size, we can't really just read it by going back from the location pointed by DW_AT_rnglists_base. We currently use the header to validate that the index is valid, so unfortunately I think it means we won't be able to do that. At least, not unless we do a first pass to slurp the entire .debug_rnglists section to know where the various contributions are and how many offsets they have. -- You are receiving this mail because: You are on the CC list for the bug.
next prev parent reply other threads:[~2020-10-30 19:03 UTC|newest] Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-10-29 17:30 [Bug symtab/26813] New: " zoran.zaric at amd dot com 2020-10-29 17:33 ` [Bug symtab/26813] " zoran.zaric at amd dot com 2020-10-29 18:08 ` simark at simark dot ca 2020-10-30 14:22 ` tromey at sourceware dot org 2020-10-30 15:03 ` zoran.zaric at amd dot com 2020-10-30 18:21 ` simark at simark dot ca 2020-10-30 18:22 ` simark at simark dot ca 2020-10-30 19:03 ` simark at simark dot ca [this message] 2020-10-30 21:19 ` simark at simark dot ca 2020-11-02 15:57 ` simark at simark dot ca 2021-01-20 9:26 ` mliska at suse dot cz 2021-02-02 15:42 ` cvs-commit at gcc dot gnu.org 2021-02-02 15:43 ` cvs-commit at gcc dot gnu.org 2021-02-02 15:43 ` cvs-commit at gcc dot gnu.org 2021-02-02 15:43 ` cvs-commit at gcc dot gnu.org 2021-02-02 15:43 ` simark at simark dot ca 2021-02-03 19:17 ` cvs-commit at gcc dot gnu.org 2021-02-03 19:17 ` cvs-commit at gcc dot gnu.org 2021-02-03 19:17 ` cvs-commit at gcc dot gnu.org 2022-05-15 12:13 ` jeanmichael.celerier at gmail dot com 2022-05-15 14:33 ` tromey at sourceware dot org 2022-05-15 14:55 ` jeanmichael.celerier at gmail dot com 2022-05-15 15:09 ` tromey at sourceware dot org 2022-05-16 1:12 ` simark at simark dot ca
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-26813-4717-dkhxb6XvRW@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=gdb-prs@sourceware.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).