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 gdb/28004] DW_AT_ranges with form DW_FORM_sec_offset problem
Date: Fri, 25 Jun 2021 21:40:56 +0000	[thread overview]
Message-ID: <bug-28004-4717-rQ5Cofz9Xi@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28004-4717@http.sourceware.org/bugzilla/>

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

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #4)
> This fixes the warning:
> ...
> diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
> index 07bc08fba14..96bfb1280e1 100644
> --- a/gdb/dwarf2/read.c
> +++ b/gdb/dwarf2/read.c
> @@ -13604,7 +13604,6 @@ dwarf2_rnglists_process (unsigned offset, struct
> dwarf2_cu *cu
> ,
>    /* Base address selection entry.  */
>    gdb::optional<CORE_ADDR> base;
>    const gdb_byte *buffer;
> -  CORE_ADDR baseaddr;
>    bool overflow = false;
>    ULONGEST addr_index;
>    struct dwarf2_section_info *rnglists_section;
> @@ -13621,8 +13620,6 @@ dwarf2_rnglists_process (unsigned offset, struct
> dwarf2_cu *cu
> ,
>      }
>    buffer = rnglists_section->buffer + offset;
>  
> -  baseaddr = objfile->text_section_offset ();
> -
>    while (1)
>      {--
>        /* Initialize it due to a false compiler warning.  */
> @@ -13764,7 +13761,7 @@ dwarf2_rnglists_process (unsigned offset, struct
> dwarf2_cu *cu
> ,
>  
>        /* A not-uncommon case of bad debug info.
>          Don't pollute the addrmap with bad data.  */
> -      if (range_beginning + baseaddr == 0
> +      if (range_beginning == 0
>           && !per_objfile->per_bfd->has_section_at_zero)
>         {
>           complaint (_(".debug_rnglists entry has start address of zero"
> ...
> which means we no longer trigger the assert when rerunning.  Doesn't fix the
> assert as such though.

There's similar code for .debug_ranges.

I've tested a patch with both fixes on openSUSE Leap 15.2 x86_64 (gcc 7.5.0,
using .debug_ranges), and on openSUSE Tumbleweed x86_64 (gcc 11.1.1, using
.debug_rnglists).

/me -> vacation for 1 week.

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

  parent reply	other threads:[~2021-06-25 21:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22  5:26 [Bug gdb/28004] New: " simark at simark dot ca
2021-06-22  5:26 ` [Bug gdb/28004] " simark at simark dot ca
2021-06-22  5:29 ` simark at simark dot ca
2021-06-25  7:03 ` vries at gcc dot gnu.org
2021-06-25 12:47 ` vries at gcc dot gnu.org
2021-06-25 14:23 ` vries at gcc dot gnu.org
2021-06-25 14:30 ` vries at gcc dot gnu.org
2021-06-25 21:40 ` vries at gcc dot gnu.org [this message]
2021-06-27 13:14 ` simark at simark dot ca
2021-07-26 16:17 ` vries at gcc dot gnu.org
2021-07-29 19:19 ` simark at simark dot ca
2021-07-29 21:27 ` vries at gcc dot gnu.org
2021-08-03 20:14 ` vries at gcc dot gnu.org
2021-08-04 14:19 ` vries at gcc dot gnu.org
2021-08-06 14:44 ` cvs-commit at gcc dot gnu.org
2021-08-06 16:02 ` cvs-commit at gcc dot gnu.org
2021-08-06 16:05 ` [Bug symtab/28004] " 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-28004-4717-rQ5Cofz9Xi@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).