Blame SOURCES/gdb-rhbz1976887-field-location-kind.patch

b94e32
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
b94e32
From: =?UTF-8?q?Alexandra=20H=C3=A1jkov=C3=A1?= <ahajkova@redhat.com>
b94e32
Date: Wed, 29 Sep 2021 10:58:50 +0200
b94e32
Subject: gdb-rhbz1976887-field-location-kind.patch
b94e32
b94e32
;;Backport upstream patch which fixes internal-error: Unexpected
b94e32
;;type field location kind (RHBZ 1976887).
b94e32
b94e32
gdbtypes.c: Add the case for FIELD_LOC_KIND_DWARF_BLOCK
b94e32
b94e32
The case for FIELD_LOC_KIND_DWARF_BLOCK was missing for
b94e32
switch TYPE_FIELD_LOC_KIND. Thas caused an internal-error
b94e32
under some circumstances.
b94e32
b94e32
Fixes bug 28030.
b94e32
b94e32
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
b94e32
--- a/gdb/gdbtypes.c
b94e32
+++ b/gdb/gdbtypes.c
b94e32
@@ -5571,6 +5571,10 @@ copy_type_recursive (struct objfile *objfile,
b94e32
 				  xstrdup (TYPE_FIELD_STATIC_PHYSNAME (type,
b94e32
 								       i)));
b94e32
 	      break;
b94e32
+            case FIELD_LOC_KIND_DWARF_BLOCK:
b94e32
+              SET_FIELD_DWARF_BLOCK (new_type->field (i),
b94e32
+                                     TYPE_FIELD_DWARF_BLOCK (type, i));
b94e32
+              break;
b94e32
 	    default:
b94e32
 	      internal_error (__FILE__, __LINE__,
b94e32
 			      _("Unexpected type field location kind: %d"),