From bcf48cc700d1f667aba7794950664a5dd83270d1 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sun, 26 Oct 2003 13:08:57 +0000 Subject: [PATCH] Change register numbers to enumartion values. * i386-tdep.h (enum i386_regnum): New. (I386_EAX_REGNUM, I386_EDX_REGNUM, I386_ESP_REGNUM, I386_EBP_REGNUM, I386_IP_REGNUM, I386_EFLAGS_REGNUM, I386_ST0_REGNUM): Remove defines. * i386-tdep.c (I386_EBX_REGNUM, I386_ECX_REGNUM, I386_ESI_REGNUM, I386_EDI_REGNUM): Remove defines. --- gdb/ChangeLog | 10 ++++++++++ gdb/i386-tdep.c | 8 -------- gdb/i386-tdep.h | 21 ++++++++++++++------- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a34ac63b60b..f460b93895d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2003-10-26 Mark Kettenis + + Change register numbers to enumartion values. + * i386-tdep.h (enum i386_regnum): New. + (I386_EAX_REGNUM, I386_EDX_REGNUM, I386_ESP_REGNUM, + I386_EBP_REGNUM, I386_IP_REGNUM, I386_EFLAGS_REGNUM, + I386_ST0_REGNUM): Remove defines. + * i386-tdep.c (I386_EBX_REGNUM, I386_ECX_REGNUM, I386_ESI_REGNUM, + I386_EDI_REGNUM): Remove defines. + 2003-10-24 Andrew Cagney * target.c: Include "gdbcore.h". diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 21721de6d3b..e8d42a12b97 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -1418,14 +1418,6 @@ i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, } -/* These registers don't have pervasive standard uses. Move them to - i386-tdep.h if necessary. */ - -#define I386_EBX_REGNUM 3 /* %ebx */ -#define I386_ECX_REGNUM 1 /* %ecx */ -#define I386_ESI_REGNUM 6 /* %esi */ -#define I386_EDI_REGNUM 7 /* %edi */ - /* Return the register number of the register allocated by GCC after REGNUM, or -1 if there is no such register. */ diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h index 59668d6b608..cb42a1b9a76 100644 --- a/gdb/i386-tdep.h +++ b/gdb/i386-tdep.h @@ -160,13 +160,20 @@ extern int i386_fpc_regnum_p (int regnum); /* Register numbers of various important registers. */ -#define I386_EAX_REGNUM 0 /* %eax */ -#define I386_EDX_REGNUM 2 /* %edx */ -#define I386_ESP_REGNUM 4 /* %esp */ -#define I386_EBP_REGNUM 5 /* %ebp */ -#define I386_EIP_REGNUM 8 /* %eip */ -#define I386_EFLAGS_REGNUM 9 /* %eflags */ -#define I386_ST0_REGNUM 16 /* %st(0) */ +enum i386_regnum +{ + I386_EAX_REGNUM, /* %eax */ + I386_ECX_REGNUM, /* %ecx */ + I386_EDX_REGNUM, /* %edx */ + I386_EBX_REGNUM, /* %ebx */ + I386_ESP_REGNUM, /* %esp */ + I386_EBP_REGNUM, /* %ebp */ + I386_ESI_REGNUM, /* %esi */ + I386_EDI_REGNUM, /* %edi */ + I386_EIP_REGNUM, /* %eip */ + I386_EFLAGS_REGNUM, /* %eflags */ + I386_ST0_REGNUM = 16, /* %st(0) */ +}; #define I386_NUM_GREGS 16 #define I386_NUM_FREGS 16 -- 2.30.2