For gdb-4.17 : COFF and unsigned enum's

Philippe De Muyter phdm@macqel.be
Mon Feb 9 21:43:00 GMT 1998


The following patch fixes the unsigned enum bitfield FAIL's in
gdb.base/setvar.exp (on m68k-motorola-syv).

Mon Feb  9 16:47:11 1998  Philippe De Muyter  <phdm@macqel.be>

	* coffread.c (coff_read_enum_type): Set TYPE_FLAG_UNSIGNED if enum
	is unsigned.

--- ./gdb/coffread.c	Mon Feb  9 16:44:48 1998
+++ ./gdb/coffread.c	Mon Feb  9 13:01:56 1998
@@ -2090,6 +2093,7 @@ coff_read_enum_type (index, length, last
   int o_nsyms;
   register int n;
   char *name;
+  int unsigned_enum = 1;
 
   type = coff_alloc_type (index);
   if (within_function)
@@ -2163,11 +2167,16 @@ coff_read_enum_type (index, length, last
 	  SYMBOL_TYPE (xsym) = type;
 	  TYPE_FIELD_NAME (type, n) = SYMBOL_NAME (xsym);
 	  TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (xsym);
+	  if (SYMBOL_VALUE (xsym) < 0)
+	    unsigned_enum = 0;
 	  TYPE_FIELD_BITSIZE (type, n) = 0;
 	}
       if (syms == osyms)
 	break;
     }
+
+  if (unsigned_enum)
+    TYPE_FLAGS (type) |= TYPE_FLAG_UNSIGNED;
 
   return type;
 }



More information about the Gdb-patches mailing list