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

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