public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH] Issue complaint instead of assert for invalid/unhandled DW_AT_accessibility
Date: Tue, 17 Oct 2017 21:38:00 -0000	[thread overview]
Message-ID: <1508276312-7910-1-git-send-email-keiths@redhat.com> (raw)
In-Reply-To: <9431dc9a-2156-10d7-8fbd-b46d5af9a72f@redhat.com>

A previous patch called gdb_assert_not_reached whenever reading
the accessibility of a nested typedef definition. Wisely, Pedro has asked me
not do this.

This patch changes the previous one so that it issues a complaint instead.

gdb/ChangeLog:

	* dwarf2read.c (dwarf2_add_typedef): Issue a complaint on unhandled
	DW_AT_accessibility.
---
 gdb/ChangeLog    | 5 +++++
 gdb/dwarf2read.c | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e16b048..4afd897 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2017-10-17  Keith Seitz  <keiths@redhat.com>
+
+	* dwarf2read.c (dwarf2_add_typedef): Issue a complaint on unhandled
+	DW_AT_accessibility.
+
 2017-10-17  Tom Tromey  <tom@tromey.com>
 
 	* disasm.c (do_mixed_source_and_assembly_deprecated): Use
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index f27d9b9..686fa3f 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -13131,7 +13131,8 @@ dwarf2_add_typedef (struct field_info *fip, struct die_info *die,
       fp->is_protected = 1;
       break;
     default:
-      gdb_assert_not_reached ("unexpected accessibility attribute");
+      complaint (&symfile_complaints,
+		 _("Unhandled DW_AT_accessibility value (%x)"), accessibility);
     }
 
   new_field->next = fip->typedef_field_list;
-- 
2.1.0

  reply	other threads:[~2017-10-17 21:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13 19:18 [PATCH] Record and output access specifiers for nested typedefs 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
2017-10-17 21:38       ` Keith Seitz [this message]
2017-10-18 10:21         ` [PATCH] Issue complaint instead of assert for invalid/unhandled DW_AT_accessibility 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=1508276312-7910-1-git-send-email-keiths@redhat.com \
    --to=keiths@redhat.com \
    --cc=gdb-patches@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).