* [RFA] Fix sparc64 pop/push frame reg saving
@ 2002-04-20 1:47 David S. Miller
2002-04-23 12:45 ` Michael Snyder
0 siblings, 1 reply; 5+ messages in thread
From: David S. Miller @ 2002-04-20 1:47 UTC (permalink / raw)
To: gdb-patches
This makes sure that all the correct regs get saved
in push/pop regs on sparc64.
sparc32 sparc64
failures before 83 111
failures after 83 110
2002-04-20 David S. Miller <davem@redhat.com>
* sparc-tdep.c (sparc_push_dummy_frame): Save Y, PC, NPC, CCR, FSR
properly on sparc64.
(sparc_push_dummy_frame): Find them in the right spot.
(sparc_pop_frame): Restore them properly.
--- sparc-tdep.c.~1~ Fri Apr 19 23:53:57 2002
+++ sparc-tdep.c Sat Apr 20 00:34:53 2002
@@ -960,13 +960,10 @@ sparc_push_dummy_frame (void)
if (GDB_TARGET_IS_SPARC64)
{
- /* PC, NPC, CCR, FSR, FPRS, Y, ASI */
- read_register_bytes (REGISTER_BYTE (PC_REGNUM), ®ister_temp[0],
- REGISTER_RAW_SIZE (PC_REGNUM) * 7);
- read_register_bytes (REGISTER_BYTE (PSTATE_REGNUM),
- ®ister_temp[7 * SPARC_INTREG_SIZE],
- REGISTER_RAW_SIZE (PSTATE_REGNUM));
- /* FIXME: not sure what needs to be saved here. */
+ /* Y, PC, NPC, CCR, FSR */
+ read_register_bytes (REGISTER_BYTE (Y_REGNUM),
+ ®ister_temp[0],
+ REGISTER_RAW_SIZE (Y_REGNUM) * 5);
}
else
{
@@ -1111,14 +1108,10 @@ sparc_frame_find_saved_regs (struct fram
if (GDB_TARGET_IS_SPARC64)
{
- for (regnum = PC_REGNUM; regnum < PC_REGNUM + 7; regnum++)
- {
- saved_regs_addr[regnum] =
- frame_addr + (regnum - PC_REGNUM) * SPARC_INTREG_SIZE
- - DUMMY_STACK_REG_BUF_SIZE;
- }
- saved_regs_addr[PSTATE_REGNUM] =
- frame_addr + 8 * SPARC_INTREG_SIZE - DUMMY_STACK_REG_BUF_SIZE;
+ for (regnum = Y_REGNUM; regnum <= FSR_REGNUM; regnum++)
+ saved_regs_addr[regnum] =
+ frame_addr + (regnum - Y_REGNUM) * SPARC_INTREG_SIZE
+ - DUMMY_STACK_REG_BUF_SIZE;
}
else
for (regnum = Y_REGNUM; regnum < NUM_REGS; regnum++)
@@ -1173,7 +1166,6 @@ sparc_frame_find_saved_regs (struct fram
}
}
/* Otherwise, whatever we would get from ptrace(GETREGS) is accurate */
- /* FIXME -- should this adjust for the sparc64 offset? */
saved_regs_addr[SP_REGNUM] = FRAME_FP (fi);
}
@@ -1224,6 +1216,14 @@ sparc_pop_frame (void)
write_register_gen (CPS_REGNUM, raw_buffer);
}
}
+ else
+ {
+ if (fsr[FSR_REGNUM])
+ {
+ read_memory (fsr[FSR_REGNUM], raw_buffer, SPARC_INTREG_SIZE);
+ write_register_gen (FSR_REGNUM, raw_buffer);
+ }
+ }
}
if (fsr[G1_REGNUM])
{
@@ -1289,10 +1289,19 @@ sparc_pop_frame (void)
}
if (!(GDB_TARGET_IS_SPARC64))
- if (fsr[PS_REGNUM])
- write_register (PS_REGNUM,
- read_memory_integer (fsr[PS_REGNUM],
- REGISTER_RAW_SIZE (PS_REGNUM)));
+ {
+ if (fsr[PS_REGNUM])
+ write_register (PS_REGNUM,
+ read_memory_integer (fsr[PS_REGNUM],
+ REGISTER_RAW_SIZE (PS_REGNUM)));
+ }
+ else
+ {
+ if (fsr[CCR_REGNUM])
+ write_register (CCR_REGNUM,
+ read_memory_integer (fsr[CCR_REGNUM],
+ REGISTER_RAW_SIZE (CCR_REGNUM)));
+ }
if (fsr[Y_REGNUM])
write_register (Y_REGNUM,
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA] Fix sparc64 pop/push frame reg saving
2002-04-20 1:47 [RFA] Fix sparc64 pop/push frame reg saving David S. Miller
@ 2002-04-23 12:45 ` Michael Snyder
2002-04-23 18:20 ` Andrew Cagney
2002-04-23 21:55 ` David S. Miller
0 siblings, 2 replies; 5+ messages in thread
From: Michael Snyder @ 2002-04-23 12:45 UTC (permalink / raw)
To: David S. Miller; +Cc: gdb-patches
"David S. Miller" wrote:
>
> This makes sure that all the correct regs get saved
> in push/pop regs on sparc64.
>
> sparc32 sparc64
> failures before 83 111
> failures after 83 110
David, I see that this is based on your renumbering of the
sparc64 registers (submitted separately). I don't think
that renumbering is allowable. Even if we disregarded
embedded sparc64 targets, wouldn't this break Solaris?
>
> 2002-04-20 David S. Miller <davem@redhat.com>
>
> * sparc-tdep.c (sparc_push_dummy_frame): Save Y, PC, NPC, CCR, FSR
> properly on sparc64.
> (sparc_push_dummy_frame): Find them in the right spot.
> (sparc_pop_frame): Restore them properly.
>
> --- sparc-tdep.c.~1~ Fri Apr 19 23:53:57 2002
> +++ sparc-tdep.c Sat Apr 20 00:34:53 2002
> @@ -960,13 +960,10 @@ sparc_push_dummy_frame (void)
>
> if (GDB_TARGET_IS_SPARC64)
> {
> - /* PC, NPC, CCR, FSR, FPRS, Y, ASI */
> - read_register_bytes (REGISTER_BYTE (PC_REGNUM), ®ister_temp[0],
> - REGISTER_RAW_SIZE (PC_REGNUM) * 7);
> - read_register_bytes (REGISTER_BYTE (PSTATE_REGNUM),
> - ®ister_temp[7 * SPARC_INTREG_SIZE],
> - REGISTER_RAW_SIZE (PSTATE_REGNUM));
> - /* FIXME: not sure what needs to be saved here. */
> + /* Y, PC, NPC, CCR, FSR */
> + read_register_bytes (REGISTER_BYTE (Y_REGNUM),
> + ®ister_temp[0],
> + REGISTER_RAW_SIZE (Y_REGNUM) * 5);
> }
> else
> {
> @@ -1111,14 +1108,10 @@ sparc_frame_find_saved_regs (struct fram
>
> if (GDB_TARGET_IS_SPARC64)
> {
> - for (regnum = PC_REGNUM; regnum < PC_REGNUM + 7; regnum++)
> - {
> - saved_regs_addr[regnum] =
> - frame_addr + (regnum - PC_REGNUM) * SPARC_INTREG_SIZE
> - - DUMMY_STACK_REG_BUF_SIZE;
> - }
> - saved_regs_addr[PSTATE_REGNUM] =
> - frame_addr + 8 * SPARC_INTREG_SIZE - DUMMY_STACK_REG_BUF_SIZE;
> + for (regnum = Y_REGNUM; regnum <= FSR_REGNUM; regnum++)
> + saved_regs_addr[regnum] =
> + frame_addr + (regnum - Y_REGNUM) * SPARC_INTREG_SIZE
> + - DUMMY_STACK_REG_BUF_SIZE;
> }
> else
> for (regnum = Y_REGNUM; regnum < NUM_REGS; regnum++)
> @@ -1173,7 +1166,6 @@ sparc_frame_find_saved_regs (struct fram
> }
> }
> /* Otherwise, whatever we would get from ptrace(GETREGS) is accurate */
> - /* FIXME -- should this adjust for the sparc64 offset? */
> saved_regs_addr[SP_REGNUM] = FRAME_FP (fi);
> }
>
> @@ -1224,6 +1216,14 @@ sparc_pop_frame (void)
> write_register_gen (CPS_REGNUM, raw_buffer);
> }
> }
> + else
> + {
> + if (fsr[FSR_REGNUM])
> + {
> + read_memory (fsr[FSR_REGNUM], raw_buffer, SPARC_INTREG_SIZE);
> + write_register_gen (FSR_REGNUM, raw_buffer);
> + }
> + }
> }
> if (fsr[G1_REGNUM])
> {
> @@ -1289,10 +1289,19 @@ sparc_pop_frame (void)
> }
>
> if (!(GDB_TARGET_IS_SPARC64))
> - if (fsr[PS_REGNUM])
> - write_register (PS_REGNUM,
> - read_memory_integer (fsr[PS_REGNUM],
> - REGISTER_RAW_SIZE (PS_REGNUM)));
> + {
> + if (fsr[PS_REGNUM])
> + write_register (PS_REGNUM,
> + read_memory_integer (fsr[PS_REGNUM],
> + REGISTER_RAW_SIZE (PS_REGNUM)));
> + }
> + else
> + {
> + if (fsr[CCR_REGNUM])
> + write_register (CCR_REGNUM,
> + read_memory_integer (fsr[CCR_REGNUM],
> + REGISTER_RAW_SIZE (CCR_REGNUM)));
> + }
>
> if (fsr[Y_REGNUM])
> write_register (Y_REGNUM,
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA] Fix sparc64 pop/push frame reg saving
2002-04-23 12:45 ` Michael Snyder
@ 2002-04-23 18:20 ` Andrew Cagney
2002-04-23 21:55 ` David S. Miller
1 sibling, 0 replies; 5+ messages in thread
From: Andrew Cagney @ 2002-04-23 18:20 UTC (permalink / raw)
To: Michael Snyder; +Cc: David S. Miller, gdb-patches
>
> David, I see that this is based on your renumbering of the
> sparc64 registers (submitted separately). I don't think
> that renumbering is allowable. Even if we disregarded
> embedded sparc64 targets, wouldn't this break Solaris?
Yes. The macro's REGISTER_RAW_SIZE an REGISTER_BYTE are
``untouchable''. At least for the moment. Should dust off my remote.c
code.
Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA] Fix sparc64 pop/push frame reg saving
2002-04-23 12:45 ` Michael Snyder
2002-04-23 18:20 ` Andrew Cagney
@ 2002-04-23 21:55 ` David S. Miller
2002-04-24 11:26 ` Michael Snyder
1 sibling, 1 reply; 5+ messages in thread
From: David S. Miller @ 2002-04-23 21:55 UTC (permalink / raw)
To: msnyder; +Cc: gdb-patches
From: Michael Snyder <msnyder@redhat.com>
Date: Tue, 23 Apr 2002 12:33:01 -0700
David, I see that this is based on your renumbering of the
sparc64 registers (submitted separately). I don't think
that renumbering is allowable. Even if we disregarded
embedded sparc64 targets, wouldn't this break Solaris?
Solaris would not break, no.
It is a shame that embedded will prevent a renumbering, since
the numbers were choosen a little bit poorly, but what can
we do :(
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA] Fix sparc64 pop/push frame reg saving
2002-04-23 21:55 ` David S. Miller
@ 2002-04-24 11:26 ` Michael Snyder
0 siblings, 0 replies; 5+ messages in thread
From: Michael Snyder @ 2002-04-24 11:26 UTC (permalink / raw)
To: David S. Miller; +Cc: gdb-patches
"David S. Miller" wrote:
>
> From: Michael Snyder <msnyder@redhat.com>
> Date: Tue, 23 Apr 2002 12:33:01 -0700
>
> David, I see that this is based on your renumbering of the
> sparc64 registers (submitted separately). I don't think
> that renumbering is allowable. Even if we disregarded
> embedded sparc64 targets, wouldn't this break Solaris?
>
> Solaris would not break, no.
>
> It is a shame that embedded will prevent a renumbering, since
> the numbers were choosen a little bit poorly, but what can
> we do :(
That's just one of the crosses we bear (bare?)
Once a numbering is released, it is set in stone.
It's often inconvenient, and I believe someone is
working on a solution.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-04-24 18:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-20 1:47 [RFA] Fix sparc64 pop/push frame reg saving David S. Miller
2002-04-23 12:45 ` Michael Snyder
2002-04-23 18:20 ` Andrew Cagney
2002-04-23 21:55 ` David S. Miller
2002-04-24 11:26 ` Michael Snyder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox