Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix reading floating point registers from core files on hppa-linux
@ 2008-09-13 23:44 John David Anglin
  2008-09-14  1:07 ` Randolph Chung
  0 siblings, 1 reply; 3+ messages in thread
From: John David Anglin @ 2008-09-13 23:44 UTC (permalink / raw)
  To: gdb-patches; +Cc: randolph

I noticed the failure of gcore.exp in testing the previous patch.  This
change fixes the problem.  regcache_raw_supply only copies four bytes
on hppa--unknown-linux-gnu.

Ok?

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2008-09-13  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	* hppa-linux-tdep.c (hppa_linux_supply_fpregset): Correct iteration.

Index: hppa-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-linux-tdep.c,v
retrieving revision 1.31
diff -u -3 -p -r1.31 hppa-linux-tdep.c
--- hppa-linux-tdep.c	21 Aug 2008 13:19:18 -0000	1.31
+++ hppa-linux-tdep.c	13 Sep 2008 22:51:35 -0000
@@ -474,12 +477,12 @@ hppa_linux_supply_fpregset (const struct
   int i, offset;
 
   offset = 0;
-  for (i = 0; i < 31; i++)
+  for (i = 0; i < 64; i++)
     {
       if (regnum == HPPA_FP0_REGNUM + i || regnum == -1)
         regcache_raw_supply (regcache, HPPA_FP0_REGNUM + i, 
 			     buf + offset);
-      offset += 8;
+      offset += 4;
     }
 }
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix reading floating point registers from core files on hppa-linux
  2008-09-13 23:44 [PATCH] Fix reading floating point registers from core files on hppa-linux John David Anglin
@ 2008-09-14  1:07 ` Randolph Chung
  2008-09-14  1:53   ` John David Anglin
  0 siblings, 1 reply; 3+ messages in thread
From: Randolph Chung @ 2008-09-14  1:07 UTC (permalink / raw)
  To: John David Anglin; +Cc: gdb-patches

Hm.... gcore used to pass... wonder what changed. But your code below
looks reasonable.

randolph

On Sat, Sep 13, 2008 at 4:43 PM, John David Anglin
<dave@hiauly1.hia.nrc.ca> wrote:
> I noticed the failure of gcore.exp in testing the previous patch.  This
> change fixes the problem.  regcache_raw_supply only copies four bytes
> on hppa--unknown-linux-gnu.
>
> Ok?
>
> Dave
> --
> J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
> National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
>
> 2008-09-13  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
>
>        * hppa-linux-tdep.c (hppa_linux_supply_fpregset): Correct iteration.
>
> Index: hppa-linux-tdep.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/hppa-linux-tdep.c,v
> retrieving revision 1.31
> diff -u -3 -p -r1.31 hppa-linux-tdep.c
> --- hppa-linux-tdep.c   21 Aug 2008 13:19:18 -0000      1.31
> +++ hppa-linux-tdep.c   13 Sep 2008 22:51:35 -0000
> @@ -474,12 +477,12 @@ hppa_linux_supply_fpregset (const struct
>   int i, offset;
>
>   offset = 0;
> -  for (i = 0; i < 31; i++)
> +  for (i = 0; i < 64; i++)
>     {
>       if (regnum == HPPA_FP0_REGNUM + i || regnum == -1)
>         regcache_raw_supply (regcache, HPPA_FP0_REGNUM + i,
>                             buf + offset);
> -      offset += 8;
> +      offset += 4;
>     }
>  }
>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix reading floating point registers from core files on hppa-linux
  2008-09-14  1:07 ` Randolph Chung
@ 2008-09-14  1:53   ` John David Anglin
  0 siblings, 0 replies; 3+ messages in thread
From: John David Anglin @ 2008-09-14  1:53 UTC (permalink / raw)
  To: Randolph Chung; +Cc: gdb-patches

> Hm.... gcore used to pass... wonder what changed. But your code below
> looks reasonable.

Looking at the gdb.log, it was clear that the fpregs were not being
restored from the core file correctly.  Possibly, the register checks
were added.

I believe the code is correct for the 32-bit runtime.  I can see that
changes would be needed to support a 64-bit runtime.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-09-14  1:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-13 23:44 [PATCH] Fix reading floating point registers from core files on hppa-linux John David Anglin
2008-09-14  1:07 ` Randolph Chung
2008-09-14  1:53   ` John David Anglin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox