]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add CodeView enum cv_sym_type
authorMark Harmstone <mark@harmstone.com>
Thu, 27 Jun 2024 23:30:49 +0000 (00:30 +0100)
committerMark Harmstone <mark@harmstone.com>
Sat, 13 Jul 2024 20:53:18 +0000 (21:53 +0100)
Make everything more gdb-friendly by using an enum for symbol constants
rather than #defines.

gcc/
* dwarf2codeview.cc (S_LDATA32, S_GDATA32, S_COMPILE3): Undefine.
(enum cv_sym_type): Define.
(struct codeview_symbol): Use enum cv_sym_type.
(write_codeview_symbols): Add default to switch.

gcc/dwarf2codeview.cc

index 5155aa7013941498b1e183d618eb4b08ae9642f3..921d5f41e5a4b08fa71973a6cdb45dd78f08c2da 100644 (file)
@@ -46,10 +46,6 @@ along with GCC; see the file COPYING3.  If not see
 
 #define CHKSUM_TYPE_MD5                1
 
-#define S_LDATA32              0x110c
-#define S_GDATA32              0x110d
-#define S_COMPILE3             0x113c
-
 #define CV_CFL_80386           0x03
 #define CV_CFL_X64             0xD0
 
@@ -70,6 +66,14 @@ along with GCC; see the file COPYING3.  If not see
 
 #define HASH_SIZE 16
 
+/* This is enum SYM_ENUM_e in Microsoft's cvinfo.h.  */
+
+enum cv_sym_type {
+  S_LDATA32 = 0x110c,
+  S_GDATA32 = 0x110d,
+  S_COMPILE3 = 0x113c
+};
+
 /* This is enum LEAF_ENUM_e in Microsoft's cvinfo.h.  */
 
 enum cv_leaf_type {
@@ -168,7 +172,7 @@ struct codeview_function
 struct codeview_symbol
 {
   codeview_symbol *next;
-  uint16_t kind;
+  enum cv_sym_type kind;
 
   union
   {
@@ -983,6 +987,8 @@ write_codeview_symbols (void)
        case S_GDATA32:
          write_data_symbol (sym);
          break;
+       default:
+         break;
        }
 
       free (sym);