public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug symtab/28200] DW_AT_ranges handling in partial_die_info::read does not handle discontinuous ranges
Date: Fri, 06 Aug 2021 11:57:08 +0000	[thread overview]
Message-ID: <bug-28200-4717-YsUsuvzkNQ@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28200-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=28200

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
Essentially, there are two interpretations of has_pc_info:
- this is not something to be ignored, build a symbol in the partial symbol
  table
- the field lowpc and highpc are valid.

The code:
...
            if (dwarf2_ranges_read (ranges_offset, &lowpc, &highpc, cu,
                                    nullptr, tag))
              has_pc_info = 1;
...
uses the first interpretation to fix the problem that a symbol is not listed in
the partial symbol table.

Which also implies the second interpretation, which apparently usually doesn't
cause much trouble, but evidently it does in combination with this workaround
for gcc 4.8 (see PR15231):
...
          scan_partial_symbols (first_die, &lowpc, &highpc,
                                cu_bounds_kind <= PC_BOUNDS_INVALID, cu);
...

So, at this point I see two potential solutions:
- add an address map along side lowpc/highpc and pass that instead of nullptr
to 
  dwarf2_ranges_read, and handle things from there-on
- split up the two interpretations of has_pc_info, say by adding
  highlowpc_valid (or have_ranges), and when encountering DW_AT_ranges
  just mark highlowpc_valid = 0 and has_pc_info = 1, and deferring reading
  the ranges till we have the partial symtab address map to work with.

My guess is that the latter is more space-efficient.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2021-08-06 11:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06 11:03 [Bug symtab/28200] New: " vries at gcc dot gnu.org
2021-08-06 11:04 ` [Bug symtab/28200] " vries at gcc dot gnu.org
2021-08-06 11:18 ` vries at gcc dot gnu.org
2021-08-06 11:57 ` vries at gcc dot gnu.org [this message]
2021-08-06 13:18 ` simark at simark dot ca
2021-08-06 14:23 ` vries at gcc dot gnu.org
2021-08-06 14:28 ` vries at gcc dot gnu.org
2021-08-06 15:44 ` simark at simark dot ca
2021-08-06 15:57 ` vries at gcc dot gnu.org
2021-08-06 16:46 ` simark at simark dot ca
2021-08-10 13:38 ` vries at gcc dot gnu.org
2021-08-10 15:06 ` vries at gcc dot gnu.org
2021-08-10 15:06 ` vries at gcc dot gnu.org
2021-08-24 14:29 ` brobecker at gnat dot com
2021-08-24 14:58 ` vries at gcc dot gnu.org
2021-09-14 12:41 ` cvs-commit at gcc dot gnu.org
2021-09-14 12:56 ` 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-28200-4717-YsUsuvzkNQ@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: link
Be 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).