From: Pedro Alves <palves@redhat.com>
To: Keith Seitz <keiths@redhat.com>, simon.marchi@ericsson.com
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Record and output access specifiers for nested typedefs
Date: Tue, 17 Oct 2017 01:05:00 -0000 [thread overview]
Message-ID: <9431dc9a-2156-10d7-8fbd-b46d5af9a72f@redhat.com> (raw)
In-Reply-To: <1508189538-6733-1-git-send-email-keiths@redhat.com>
On 10/16/2017 10:32 PM, Keith Seitz wrote:
> @@ -13274,6 +13274,28 @@ dwarf2_add_typedef (struct field_info *fip, struct die_info *die,
>
> fp->type = read_type_die (die, cu);
>
> + /* Save accessibility. */
> + enum dwarf_access_attribute accessibility;
> + struct attribute *attr = dwarf2_attr (die, DW_AT_accessibility, cu);
> + if (attr != NULL)
> + accessibility = (enum dwarf_access_attribute) DW_UNSND (attr);
> + else
> + accessibility = dwarf2_default_access_attribute (die, cu);
> + switch (accessibility)
> + {
> + case DW_ACCESS_public:
> + /* The assumed value if neither private nor protected. */
> + break;
> + case DW_ACCESS_private:
> + fp->is_private = 1;
> + break;
> + case DW_ACCESS_protected:
> + fp->is_protected = 1;
> + break;
> + default:
> + gdb_assert_not_reached ("unexpected accessibility attribute");
> + }
> +
Please don't gdb_assert on invalid input. Bogus input caused by
a buggy compiler shouldn't bring down gdb.
(I can't claim that I've really read the patch; I've barely
skimmed it, there may be other instances. Please double check.)
Thanks,
Pedro Alves
next prev parent reply other threads:[~2017-10-17 1:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-13 19:18 Keith Seitz
2017-10-16 19:57 ` Simon Marchi
2017-10-16 21:32 ` Keith Seitz
2017-10-16 21:40 ` Simon Marchi
2017-10-17 0:56 ` Keith Seitz
2017-10-17 1:05 ` Pedro Alves [this message]
2017-10-17 21:38 ` [PATCH] Issue complaint instead of assert for invalid/unhandled DW_AT_accessibility Keith Seitz
2017-10-18 10:21 ` Pedro Alves
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=9431dc9a-2156-10d7-8fbd-b46d5af9a72f@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=keiths@redhat.com \
--cc=simon.marchi@ericsson.com \
/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).