public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "sourav0311 at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug symtab/25969] Ignoring .debug_aranges with clang .debug_names
Date: Tue, 22 Sep 2020 06:18:31 +0000	[thread overview]
Message-ID: <bug-25969-4717-WPcp21xnnb@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-25969-4717@http.sourceware.org/bugzilla/>

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

Sourabh Singh Tomar <sourav0311 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sourav0311 at gmail dot com

--- Comment #2 from Sourabh Singh Tomar <sourav0311 at gmail dot com> ---
GDB when trying to parse `debug_names` also parses `debug_aranges`
section, however `debug_aranges` section is not generated/present
in `clang-trunk` generated executables. This warning is the result
of GDB not checking whether the section is even present/empty.

clang version 12.0.0

$clang -gdwarf-5 -gpubnames test.c
$readelf -S a.out | awk /debug/
  [24] .debug_abbrev     PROGBITS         0000000000000000  000009a4
  [25] .debug_info       PROGBITS         0000000000000000  000009ed
  [26] .debug_str_offset PROGBITS         0000000000000000  00000a46
  [27] .debug_str        PROGBITS         0000000000000000  00000a6e
  [28] .debug_addr       PROGBITS         0000000000000000  00000af5
  [29] .debug_names      PROGBITS         0000000000000000  00000b08
  [30] .debug_line       PROGBITS         0000000000000000  00000b78
  [31] .debug_line_str   PROGBITS         0000000000000000  00000be1


A quick fix could be:
```
static void
create_addrmap_from_aranges (dwarf2_per_objfile *per_objfile,
                             struct dwarf2_section_info *section)
{
  /*If section is empty(or not present) bail out early.*/
  if (section->empty ())
    return;
```

Because anyway we are bailing out after emitting the warning:
```
if (!insertpair.second)
        {
          warning (_("Section .debug_aranges in %s has duplicate "
                     "debug_info_offset %s, ignoring .debug_aranges."),
                   objfile_name (objfile), sect_offset_str (per_cu->sect_off));
          return;
        }
```

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

  parent reply	other threads:[~2020-09-22  6:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11  9:10 [Bug symtab/25969] New: " vries at gcc dot gnu.org
2020-05-11  9:41 ` [Bug symtab/25969] " vries at gcc dot gnu.org
2020-09-22  6:18 ` sourav0311 at gmail dot com [this message]
2023-12-05 21:04 ` tromey at sourceware dot org
2023-12-06  9:29 ` cvs-commit at gcc dot gnu.org
2023-12-06  9:36 ` 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-25969-4717-WPcp21xnnb@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).