Issue complaint instead of assert for invalid/unhandled DW_AT_accessibility

Message ID 1508276312-7910-1-git-send-email-keiths@redhat.com
State New, archived
Headers

Commit Message

Keith Seitz Oct. 17, 2017, 9:38 p.m. UTC
  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(-)
  

Comments

Pedro Alves Oct. 18, 2017, 10:21 a.m. UTC | #1
On 10/17/2017 10:38 PM, Keith Seitz wrote:
> 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.

OK.

Thanks,
Pedro Alves
  

Patch

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;