public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug symtab/27336] [dwarf-5] abort on info addr in gdb.cp/temargs.exp
Date: Wed, 24 Feb 2021 22:58:46 +0000	[thread overview]
Message-ID: <bug-27336-4717-HyKgbLxFW7@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27336-4717@http.sourceware.org/bugzilla/>

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

--- Comment #6 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=aa659cfad638376ab535bc5a7b65c164327e9e21

commit aa659cfad638376ab535bc5a7b65c164327e9e21
Author: Tom de Vries <tdevries@suse.de>
Date:   Wed Feb 24 23:58:42 2021 +0100

    [gdb/symtab] Handle DW_AT_decl_file with form DW_FORM_implicit_const

    With test-case gdb.cp/temargs.exp on target board \
    unix/gdb:debug_flags=-gdwarf-5 I run into:
    ...
    (gdb) info addr I^M
    ERROR: GDB process no longer exists
    GDB process exited with wait status 32286 exp19 0 0 CHILDKILLED SIGABRT
SIGABRT
    UNRESOLVED: gdb.cp/temargs.exp: test address of I in templ_m
    ...

    This is a regression since commit 529908cbd0a "Remove DW_UNSND".

    The problem is that this DW_AT_decl_file:
    ...
     <1><221>: Abbrev Number: 4 (DW_TAG_structure_type)
        <222>   DW_AT_name        : Base<double, 23, (& a_global), &S::f>
        <226>   DW_AT_byte_size   : 1
        <226>   DW_AT_decl_file   : 1
        <226>   DW_AT_decl_line   : 30
        <227>   DW_AT_sibling     : <0x299>
    ...
    is not read by this code in new_symbol:
    ....
          attr = dwarf2_attr (die,
                              inlined_func ? DW_AT_call_file : DW_AT_decl_file,
                              cu);
          if (attr != nullptr && attr->form_is_unsigned ())
    ...
    because DW_AT_decl_file has form DW_FORM_implicit_const:
    ...
       4      DW_TAG_structure_type    [has children]
        DW_AT_name         DW_FORM_strp
        DW_AT_byte_size    DW_FORM_implicit_const: 1
        DW_AT_decl_file    DW_FORM_implicit_const: 1
        DW_AT_decl_line    DW_FORM_data1
        DW_AT_sibling      DW_FORM_ref4
        DW_AT value: 0     DW_FORM value: 0
    ...
    which is a signed LEB128, so attr->form_is_unsigned () returns false.

    Fix this by introducing new functions is_nonnegative and as_nonnegative,
and
    use these instead of form_is_unsigned and as_unsigned.

    Tested on x86_64-linux.

    gdb/ChangeLog:

    2021-02-24  Tom de Vries  <tdevries@suse.de>

            PR symtab/27336
            * dwarf2/attribute.c (attribute::form_is_signed): New function
            factored out of ...
            * dwarf2/attribute.h (attribute::as_signed): ... here.
            (attribute::is_nonnegative, attribute::as_nonnegative): New
function.
            (attribute::form_is_signed): Declare.
            * dwarf2/read.c (new_symbol): Use is_nonnegative and as_nonnegative
            for DW_AT_decl_file.

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

  parent reply	other threads:[~2021-02-24 22:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03 14:17 [Bug symtab/27336] New: " vries at gcc dot gnu.org
2021-02-03 15:28 ` [Bug symtab/27336] " vries at gcc dot gnu.org
2021-02-03 16:51 ` vries at gcc dot gnu.org
2021-02-03 18:18 ` vries at gcc dot gnu.org
2021-02-04 10:08 ` vries at gcc dot gnu.org
2021-02-05 12:32 ` vries at gcc dot gnu.org
2021-02-22  2:37 ` tromey at sourceware dot org
2021-02-24 22:58 ` cvs-commit at gcc dot gnu.org [this message]
2021-02-24 22:59 ` 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-27336-4717-HyKgbLxFW7@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).