This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA/i386]: Enable default support for SSE registers
- From: Kevin Buettner <kevinb at redhat dot com>
- To: Kevin Buettner <kevinb at redhat dot com>, gdb-patches at sources dot redhat dot com
- Date: Tue, 29 Jul 2003 08:49:32 -0700
- Subject: Re: [RFA/i386]: Enable default support for SSE registers
- References: <1030722184305.ZM4145@localhost.localdomain>
Ping?
--- Forwarded mail from Kevin Buettner <kevinb@redhat.com>
Date: Tue, 22 Jul 2003 11:43:05 -0700
From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA/i386]: Enable default support for SSE registers
I recently proposed enabling default support for SSE registers:
http://sources.redhat.com/ml/gdb/2003-07/msg00159.html
No one raised any issues, so here's a patch.
Okay?
* i386-tdep.c (i386_gdbarch_init): Enable default support for
SSE registers.
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.162
diff -u -p -r1.162 i386-tdep.c
--- i386-tdep.c 18 Jul 2003 21:31:50 -0000 1.162
+++ i386-tdep.c 22 Jul 2003 18:31:28 -0000
@@ -1716,10 +1716,23 @@ i386_gdbarch_init (struct gdbarch_info i
tdep = XMALLOC (struct gdbarch_tdep);
gdbarch = gdbarch_alloc (&info, tdep);
- /* The i386 default settings don't include the SSE registers.
+ /* The i386 default settings now include the SSE registers.
+ I386_NUM_XREGS includes mxcsr, and we don't want to count
+ this as one of the xmm regs -- which is why we subtract one.
+
+ Note: kevinb/2003-07-14: Whatever Mark's concerns are about the
+ FPU registers in the FIXME below apply to the SSE registers as well.
+ The only problem that I see is that these registers will show up
+ in "info all-registers" even on CPUs where they don't exist. IMO,
+ however, if it's a choice between printing them always (even when
+ they don't exist) or never showing them to the user (even when they
+ do exist), I prefer the former over the latter. Ideally, of course,
+ we'd somehow autodetect that we have them (or not) and display them
+ when we have them and suppress them when we don't.
+
FIXME: kettenis/20020614: They do include the FPU registers for
now, which probably is not quite right. */
- tdep->num_xmm_regs = 0;
+ tdep->num_xmm_regs = I386_NUM_XREGS - 1;
tdep->jb_pc_offset = -1;
tdep->struct_return = pcc_struct_return;
@@ -1741,9 +1754,9 @@ i386_gdbarch_init (struct gdbarch_info i
alignment. */
set_gdbarch_long_double_bit (gdbarch, 96);
- /* The default ABI includes general-purpose registers and
- floating-point registers. */
- set_gdbarch_num_regs (gdbarch, I386_NUM_GREGS + I386_NUM_FREGS);
+ /* The default ABI includes general-purpose registers,
+ floating-point registers, and the SSE registers. */
+ set_gdbarch_num_regs (gdbarch, I386_SSE_NUM_REGS);
set_gdbarch_register_name (gdbarch, i386_register_name);
set_gdbarch_register_type (gdbarch, i386_register_type);
--- End of forwarded mail from Kevin Buettner <kevinb@redhat.com>