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 14:23:04 +0000	[thread overview]
Message-ID: <bug-28004-4717-U7Tajkk49u@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 #3 from Tom de Vries <vries at gcc dot gnu.org> ---
If I just start gdb with the shared lib, and print the address map I get a very
reasonable:
...
(gdb) p /x map.transitions[0]
$16 = {addr = 0x0, value = 0x0}
(gdb) p /x map.transitions[1]
$17 = {addr = 0x99040, value = 0x1b236d0}
(gdb) p /x map.transitions[2]
$19 = {addr = 0x990bb, value = 0x0}
(gdb) p /x map.transitions[3]
$20 = {addr = 0x990bc, value = 0x1b236d0}
...
with 0x99040 being the start of the text segment:
...
Disassembly of section .text:

0000000000099040 <_ZNSi8ignoreXXEl.cold>:
   99040:       48 83 e8 01             sub    $0x1,%rax
   ...
   990bb:       90                      nop

00000000000990bc <_ZNSt13basic_istreamIwSt11char_traitsIwEE8ignoreXXEl.cold>:
...

But with the reproducer, I get:
...
(gdb) p /x map.transitions[0]
$30 = {addr = 0x0, value = 0x0}
(gdb) p /x map.transitions[1]
$31 = {addr = 0x0, value = 0x2deab60}
(gdb) p /x map.transitions[2]
$32 = {addr = 0x1d, value = 0x2591ce0}
(gdb) p /x map.transitions[3]
$33 = {addr = 0x4ef, value = 0x267bf00}
(gdb) p /x map.transitions[4]
$34 = {addr = 0xf72, value = 0x26c8ee0}
(gdb) p /x map.transitions[5]
$35 = {addr = 0x15eb, value = 0x0}
(gdb) p /x map.transitions[7]
$36 = {addr = 0x990bb, value = 0x0}
(gdb) p /x map.transitions[8]
$37 = {addr = 0x990bc, value = 0x1aced00}
...

Seems to be caused by this bit in dwarf2_rnglists_process:
...
      /* A not-uncommon case of bad debug info.                                 
         Don't pollute the addrmap with bad data.  */
      if (range_beginning + baseaddr == 0
          && !per_objfile->per_bfd->has_section_at_zero)
        {
          complaint (_(".debug_rnglists entry has start address of zero"
                       " [in module %s]"), objfile_name (objfile));
          continue;
        }
...

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

  parent reply	other threads:[~2021-06-25 14:23 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 [this message]
2021-06-25 14:30 ` vries at gcc dot gnu.org
2021-06-25 21:40 ` vries at gcc dot gnu.org
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-U7Tajkk49u@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).