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

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