Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jason Thorpe <thorpej@wasabisystems.com>
To: Jim Blandy <jimb@redhat.com>
Cc: Kevin Buettner <kevinb@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: RFA: handle missing fpregs
Date: Mon, 10 May 2004 22:28:00 -0000	[thread overview]
Message-ID: <562BFFC4-A2D1-11D8-94E3-000A957650EC@wasabisystems.com> (raw)
In-Reply-To: <vt2vfj4udwg.fsf@zenia.home>

On May 10, 2004, at 3:15 PM, Jim Blandy wrote:

Thanks for looking at this.

How about changing the comment to this:

  /* FIXME: jimb/2004-05-05: Some PPC variants don't have floating
     point registers.  Traditionally, GDB's register set has still
     listed the floating point registers for such machines, so this
     code is harmless.  However, the new E500 port actually omits the
     floating point registers entirely from the register set --- they
     don't even have register numbers assigned to them.
     It's not clear to me how best to update this code, so this assert
     will alert the first person to encounter the NetBSD/E500
     combination to the problem.  */
Ah, this clarifies the situation greatly.  I didn't realize that we 
were in E500 land with this change.

How is the change to the code itself?  The present code, if run when
the current architecture is the E500, will just inappropriate numbers
for the floating-point registers and hit the assert in
regcache_raw_supply, if you're lucky.  So the change is an improvement
over the current state of affairs.
If I am to understand correctly, the assert won't trip on e.g. 405 or 
440... if that is true (i.e. does not break NetBSD FPU-less PowerPC 
support that currently works), then it's OK with me.

Thanks!

        -- Jason R. Thorpe <thorpej@wasabisystems.com>

Attachment:
PGP.sig
Description: This is a digitally signed message part

-- 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)

iD8DBQFAoAICOpVKkaBm8XkRAjLkAJ9xtV2hUYtr/fYz7S2oPousUoc3tACfYDjT
2DrWBdZIJ18RB/v4wUzKilA=
=6MCI
-----END PGP SIGNATURE-----
From jimb@redhat.com Mon May 10 22:45:00 2004
From: Jim Blandy <jimb@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: RFA: remove meaningless code in ppc-bdm.c
Date: Mon, 10 May 2004 22:45:00 -0000
Message-id: <vt2pt9bvr42.fsf@zenia.home>
X-SW-Source: 2004-05/msg00314.html
Content-length: 2477

I was going through this trying to keep it up to date with the
register numbering changes I was making, but then I realized it was
complete jibberish.  First, the register contents are binary data; you
can't strcat them.  Second, you can't strcat them into a fixed-size
buffer that is already filled with non-zero bytes.

2004-05-10  Jim Blandy  <jimb@redhat.com>

	* ppc-bdm.c (bdm_ppc_fetch_registers): Replace utterly broken code
	with a call to internal_error.

Index: gdb/ppc-bdm.c
===================================================================
RCS file: /cvs/src/src/gdb/ppc-bdm.c,v
retrieving revision 1.22
diff -c -p -r1.22 ppc-bdm.c
*** gdb/ppc-bdm.c	10 May 2004 18:58:44 -0000	1.22
--- gdb/ppc-bdm.c	10 May 2004 22:43:08 -0000
*************** bdm_ppc_fetch_registers (int regno)
*** 155,174 ****
  {
    struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
    int i;
!   unsigned char *regs, *beginregs, *endregs, *almostregs;
!   unsigned char midregs[32];
!   unsigned char mqreg[1];
    int first_regno, last_regno;
    int first_bdm_regno, last_bdm_regno;
!   int reglen, beginreglen, endreglen;
! 
! #if 1
!   for (i = 0; i < ppc_num_fprs; i++)
!     {
!       midregs[i] = -1;
!     }
!   mqreg[0] = -1;
! #endif
  
    if (regno == -1)
      {
--- 155,164 ----
  {
    struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
    int i;
!   unsigned char *regs;
    int first_regno, last_regno;
    int first_bdm_regno, last_bdm_regno;
!   int reglen;
  
    if (regno == -1)
      {
*************** bdm_ppc_fetch_registers (int regno)
*** 217,236 ****
  	}
      }
    else
!     /* want all regs */
!     {
! /*      printf("Asking for registers %d to %d\n", first_regno, last_regno); */
!       beginregs = ocd_read_bdm_registers (first_bdm_regno,
! 					  tdep->ppc_fp0_regnum - 1,
!                                           &beginreglen);
!       endregs
!         = (strcat (midregs,
!                    ocd_read_bdm_registers (tdep->ppc_fp0_regnum + ppc_num_fprs,
!                                            last_bdm_regno - 1, &endreglen)));
!       almostregs = (strcat (beginregs, endregs));
!       regs = (strcat (almostregs, mqreg));
!       reglen = beginreglen + 32 + endreglen + 1;
!     }
  
  #endif
  #if 0
--- 207,215 ----
  	}
      }
    else
!     internal_error (__FILE__, __LINE__,
!                     "ppc_bdm_fetch_registers: "
!                     "'all registers' case not implemented");
  
  #endif
  #if 0


  reply	other threads:[~2004-05-10 22:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-07  1:19 Jim Blandy
2004-05-07 11:20 ` Mark Kettenis
2004-05-07 20:54   ` Jim Blandy
2004-05-07 20:18 ` Kevin Buettner
2004-05-07 21:09   ` Jim Blandy
2004-05-07 22:56     ` Kevin Buettner
2004-05-10 17:08       ` Jim Blandy
2004-05-10 19:00       ` Jim Blandy
     [not found]         ` <D567851C-A2B8-11D8-94E3-000A957650EC@wasabisystems.com>
2004-05-10 22:16           ` Jim Blandy
2004-05-10 22:28             ` Jason Thorpe [this message]
2004-05-11  4:55               ` Jim Blandy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=562BFFC4-A2D1-11D8-94E3-000A957650EC@wasabisystems.com \
    --to=thorpej@wasabisystems.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@redhat.com \
    --cc=kevinb@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox