* [RFA] Save SSE registers to generated core files, without breaking other architectures
@ 2002-04-02 11:55 Daniel Jacobowitz
2002-04-02 14:00 ` Michael Snyder
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2002-04-02 11:55 UTC (permalink / raw)
To: gdb-patches; +Cc: Michael Snyder
How does this patch look? The original problem was that we can not rely on
HAVE_PTRACE_FPXREGSET, because the presence of PTRACE_FPXREGSET doesn't
imply that GDB has a fill_fpxregset function available. I updated it to
check for a separate flag. It's not ideal, but until we separate regset
handling into an appropriate vector, it's the best we can do (I think).
OK?
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
2002-04-02 Daniel Jacobowitz <drow@mvista.com>
* config/i386/tm-linux.h: Define FILL_FPXREGSET.
* gregset.h: If FILL_FPXREGSET is defined, provide
gdb_fpxregset_t, supply_fpxregset, and fill_fpxregset.
* linux-proc.c (linux_do_thread_registers): If FILL_FPXREGSET
is defined, call fill_fpxregset.
Index: gregset.h
===================================================================
RCS file: /cvs/src/src/gdb/gregset.h,v
retrieving revision 1.5
diff -u -p -r1.5 gregset.h
--- gregset.h 2002/02/24 22:14:33 1.5
+++ gregset.h 2002/04/02 19:51:15
@@ -52,5 +52,18 @@ extern void supply_fpregset (gdb_fpregse
extern void fill_gregset (gdb_gregset_t *gregs, int regno);
extern void fill_fpregset (gdb_fpregset_t *fpregs, int regno);
+#ifdef FILL_FPXREGSET
+/* Linux/i386: Copy register values between GDB's internal register cache
+ and the i386 extended floating point registers. */
+
+#ifndef GDB_FPXREGSET_T
+#define GDB_FPXREGSET_T elf_fpxregset_t
+#endif
+
+typedef GDB_FPXREGSET_T gdb_fpxregset_t;
+
+extern void supply_fpxregset (gdb_fpxregset_t *fpxregs);
+extern void fill_fpxregset (gdb_fpxregset_t *fpxregs, int regno);
+#endif
#endif
Index: linux-proc.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-proc.c,v
retrieving revision 1.8
diff -u -p -r1.8 linux-proc.c
--- linux-proc.c 2002/03/25 19:47:41 1.8
+++ linux-proc.c 2002/04/02 19:51:15
@@ -167,6 +167,9 @@ linux_do_thread_registers (bfd *obfd, pt
{
gdb_gregset_t gregs;
gdb_fpregset_t fpregs;
+#ifdef FILL_FPXREGSET
+ gdb_fpxregset_t fpxregs;
+#endif
unsigned long merged_pid = ptid_get_tid (ptid) << 16 | ptid_get_pid (ptid);
fill_gregset (&gregs, -1);
@@ -183,6 +186,14 @@ linux_do_thread_registers (bfd *obfd, pt
note_size,
&fpregs,
sizeof (fpregs));
+#ifdef FILL_FPXREGSET
+ fill_fpxregset (&fpxregs, -1);
+ note_data = (char *) elfcore_write_prxfpreg (obfd,
+ note_data,
+ note_size,
+ &fpxregs,
+ sizeof (fpxregs));
+#endif
return note_data;
}
Index: config/i386/tm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/tm-linux.h,v
retrieving revision 1.17
diff -u -p -r1.17 tm-linux.h
--- tm-linux.h 2002/02/24 22:56:05 1.17
+++ tm-linux.h 2002/04/02 19:51:46
@@ -26,6 +26,7 @@
#define I386_GNULINUX_TARGET
#define HAVE_I387_REGS
#ifdef HAVE_PTRACE_GETFPXREGS
+#define FILL_FPXREGSET
#define HAVE_SSE_REGS
#endif
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [RFA] Save SSE registers to generated core files, without breaking other architectures
2002-04-02 11:55 [RFA] Save SSE registers to generated core files, without breaking other architectures Daniel Jacobowitz
@ 2002-04-02 14:00 ` Michael Snyder
2002-04-14 15:22 ` Andrew Cagney
0 siblings, 1 reply; 7+ messages in thread
From: Michael Snyder @ 2002-04-02 14:00 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
Daniel Jacobowitz wrote:
>
> How does this patch look? The original problem was that we can not rely on
> HAVE_PTRACE_FPXREGSET, because the presence of PTRACE_FPXREGSET doesn't
> imply that GDB has a fill_fpxregset function available. I updated it to
> check for a separate flag. It's not ideal, but until we separate regset
> handling into an appropriate vector, it's the best we can do (I think).
>
> OK?
Well, I like it (and thanks for working on it),
but Andrew might have something to say about adding
a new macro. Andrew?
>
> --
> Daniel Jacobowitz Carnegie Mellon University
> MontaVista Software Debian GNU/Linux Developer
>
> 2002-04-02 Daniel Jacobowitz <drow@mvista.com>
>
> * config/i386/tm-linux.h: Define FILL_FPXREGSET.
> * gregset.h: If FILL_FPXREGSET is defined, provide
> gdb_fpxregset_t, supply_fpxregset, and fill_fpxregset.
> * linux-proc.c (linux_do_thread_registers): If FILL_FPXREGSET
> is defined, call fill_fpxregset.
>
> Index: gregset.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/gregset.h,v
> retrieving revision 1.5
> diff -u -p -r1.5 gregset.h
> --- gregset.h 2002/02/24 22:14:33 1.5
> +++ gregset.h 2002/04/02 19:51:15
> @@ -52,5 +52,18 @@ extern void supply_fpregset (gdb_fpregse
> extern void fill_gregset (gdb_gregset_t *gregs, int regno);
> extern void fill_fpregset (gdb_fpregset_t *fpregs, int regno);
>
> +#ifdef FILL_FPXREGSET
> +/* Linux/i386: Copy register values between GDB's internal register cache
> + and the i386 extended floating point registers. */
> +
> +#ifndef GDB_FPXREGSET_T
> +#define GDB_FPXREGSET_T elf_fpxregset_t
> +#endif
> +
> +typedef GDB_FPXREGSET_T gdb_fpxregset_t;
> +
> +extern void supply_fpxregset (gdb_fpxregset_t *fpxregs);
> +extern void fill_fpxregset (gdb_fpxregset_t *fpxregs, int regno);
> +#endif
>
> #endif
> Index: linux-proc.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/linux-proc.c,v
> retrieving revision 1.8
> diff -u -p -r1.8 linux-proc.c
> --- linux-proc.c 2002/03/25 19:47:41 1.8
> +++ linux-proc.c 2002/04/02 19:51:15
> @@ -167,6 +167,9 @@ linux_do_thread_registers (bfd *obfd, pt
> {
> gdb_gregset_t gregs;
> gdb_fpregset_t fpregs;
> +#ifdef FILL_FPXREGSET
> + gdb_fpxregset_t fpxregs;
> +#endif
> unsigned long merged_pid = ptid_get_tid (ptid) << 16 | ptid_get_pid (ptid);
>
> fill_gregset (&gregs, -1);
> @@ -183,6 +186,14 @@ linux_do_thread_registers (bfd *obfd, pt
> note_size,
> &fpregs,
> sizeof (fpregs));
> +#ifdef FILL_FPXREGSET
> + fill_fpxregset (&fpxregs, -1);
> + note_data = (char *) elfcore_write_prxfpreg (obfd,
> + note_data,
> + note_size,
> + &fpxregs,
> + sizeof (fpxregs));
> +#endif
> return note_data;
> }
>
> Index: config/i386/tm-linux.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/config/i386/tm-linux.h,v
> retrieving revision 1.17
> diff -u -p -r1.17 tm-linux.h
> --- tm-linux.h 2002/02/24 22:56:05 1.17
> +++ tm-linux.h 2002/04/02 19:51:46
> @@ -26,6 +26,7 @@
> #define I386_GNULINUX_TARGET
> #define HAVE_I387_REGS
> #ifdef HAVE_PTRACE_GETFPXREGS
> +#define FILL_FPXREGSET
> #define HAVE_SSE_REGS
> #endif
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [RFA] Save SSE registers to generated core files, without breaking other architectures
2002-04-02 14:00 ` Michael Snyder
@ 2002-04-14 15:22 ` Andrew Cagney
2002-04-14 18:51 ` Daniel Jacobowitz
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cagney @ 2002-04-14 15:22 UTC (permalink / raw)
To: Michael Snyder, Daniel Jacobowitz; +Cc: gdb-patches
> Daniel Jacobowitz wrote:
>
>>
>> How does this patch look? The original problem was that we can not rely on
>> HAVE_PTRACE_FPXREGSET, because the presence of PTRACE_FPXREGSET doesn't
>> imply that GDB has a fill_fpxregset function available. I updated it to
>> check for a separate flag. It's not ideal, but until we separate regset
>> handling into an appropriate vector, it's the best we can do (I think).
>>
>> OK?
>
>
> Well, I like it (and thanks for working on it),
> but Andrew might have something to say about adding
> a new macro. Andrew?
>> * config/i386/tm-linux.h: Define FILL_FPXREGSET.
linux-proc.c is only built native so I think FILL_.. should only be
defined for native builds => config/i386/nm-linux.h.
Having #ifdef code enabled via a tm.h file macro just feels wrong.
enjoy,
Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Save SSE registers to generated core files, without breaking other architectures
2002-04-14 15:22 ` Andrew Cagney
@ 2002-04-14 18:51 ` Daniel Jacobowitz
2002-04-14 19:09 ` Andrew Cagney
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2002-04-14 18:51 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Michael Snyder, gdb-patches
On Sun, Apr 14, 2002 at 06:22:13PM -0400, Andrew Cagney wrote:
> >Daniel Jacobowitz wrote:
> >
> >>
> >>How does this patch look? The original problem was that we can not rely
> >>on
> >>HAVE_PTRACE_FPXREGSET, because the presence of PTRACE_FPXREGSET doesn't
> >>imply that GDB has a fill_fpxregset function available. I updated it to
> >>check for a separate flag. It's not ideal, but until we separate regset
> >>handling into an appropriate vector, it's the best we can do (I think).
> >>
> >>OK?
> >
> >
> >Well, I like it (and thanks for working on it),
> >but Andrew might have something to say about adding
> >a new macro. Andrew?
>
>
> >>* config/i386/tm-linux.h: Define FILL_FPXREGSET.
>
> linux-proc.c is only built native so I think FILL_.. should only be
> defined for native builds => config/i386/nm-linux.h.
>
> Having #ifdef code enabled via a tm.h file macro just feels wrong.
And the function in question is even in i386-linux-nat.c. nm-linux.h
sounds like the right place to put it. OK with that change, then?
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Save SSE registers to generated core files, without breaking other architectures
2002-04-14 18:51 ` Daniel Jacobowitz
@ 2002-04-14 19:09 ` Andrew Cagney
2002-04-24 14:47 ` [RFA] Save SSE registers to generated core files, without breakingother architectures Michael Snyder
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cagney @ 2002-04-14 19:09 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Michael Snyder, gdb-patches
> linux-proc.c is only built native so I think FILL_.. should only be
>> defined for native builds => config/i386/nm-linux.h.
>>
>> Having #ifdef code enabled via a tm.h file macro just feels wrong.
>
>
> And the function in question is even in i386-linux-nat.c. nm-linux.h
> sounds like the right place to put it. OK with that change, then?
(MarkK is off line for a few weeks)
Well ... Ok, is probably a bit strong :-) But yes.
Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Save SSE registers to generated core files, without breakingother architectures
2002-04-14 19:09 ` Andrew Cagney
@ 2002-04-24 14:47 ` Michael Snyder
2002-04-24 15:10 ` Daniel Jacobowitz
0 siblings, 1 reply; 7+ messages in thread
From: Michael Snyder @ 2002-04-24 14:47 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Daniel Jacobowitz, gdb-patches
Andrew Cagney wrote:
>
> > linux-proc.c is only built native so I think FILL_.. should only be
> >> defined for native builds => config/i386/nm-linux.h.
> >>
> >> Having #ifdef code enabled via a tm.h file macro just feels wrong.
> >
> >
> > And the function in question is even in i386-linux-nat.c. nm-linux.h
> > sounds like the right place to put it. OK with that change, then?
>
> (MarkK is off line for a few weeks)
>
> Well ... Ok, is probably a bit strong :-) But yes.
So Daniel -- commit it, already! ;-)
(I want to see this working!)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Save SSE registers to generated core files, without breakingother architectures
2002-04-24 14:47 ` [RFA] Save SSE registers to generated core files, without breakingother architectures Michael Snyder
@ 2002-04-24 15:10 ` Daniel Jacobowitz
0 siblings, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2002-04-24 15:10 UTC (permalink / raw)
To: gdb-patches
On Wed, Apr 24, 2002 at 02:34:52PM -0700, Michael Snyder wrote:
> Andrew Cagney wrote:
> >
> > > linux-proc.c is only built native so I think FILL_.. should only be
> > >> defined for native builds => config/i386/nm-linux.h.
> > >>
> > >> Having #ifdef code enabled via a tm.h file macro just feels wrong.
> > >
> > >
> > > And the function in question is even in i386-linux-nat.c. nm-linux.h
> > > sounds like the right place to put it. OK with that change, then?
> >
> > (MarkK is off line for a few weeks)
> >
> > Well ... Ok, is probably a bit strong :-) But yes.
>
>
> So Daniel -- commit it, already! ;-)
> (I want to see this working!)
Thanks for the nudge. Committed.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2002-04-24 22:10 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-02 11:55 [RFA] Save SSE registers to generated core files, without breaking other architectures Daniel Jacobowitz
2002-04-02 14:00 ` Michael Snyder
2002-04-14 15:22 ` Andrew Cagney
2002-04-14 18:51 ` Daniel Jacobowitz
2002-04-14 19:09 ` Andrew Cagney
2002-04-24 14:47 ` [RFA] Save SSE registers to generated core files, without breakingother architectures Michael Snyder
2002-04-24 15:10 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox