Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Randolph Chung <randolph@tausq.org>
To: gdb-patches@sources.redhat.com
Subject: [commit] cleanup use of DEPRECATED_REGISTER_BYTE in hppah-nat.c
Date: Mon, 06 Dec 2004 03:40:00 -0000	[thread overview]
Message-ID: <20041206033618.GD6359@tausq.org> (raw)

Small cleanup while i was looking at the hpux code.... committed as
obvious.

randolph

2004-12-05  Randolph Chung  <tausq@debian.org>

	* hppah-nat.c (store_inferior_registers): Rewrite logic to not use
	DEPRECATED_REGISTER_BYTE.

Index: hppah-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/hppah-nat.c,v
retrieving revision 1.35
diff -u -p -r1.35 hppah-nat.c
--- hppah-nat.c	20 Nov 2004 23:56:18 -0000	1.35
+++ hppah-nat.c	6 Dec 2004 03:33:26 -0000
@@ -114,8 +114,9 @@ store_inferior_registers (int regno)
 
       /* Floating-point registers come from the ss_fpblock area.  */
       else if (regno >= HPPA_FP0_REGNUM)
-	addr = (HPPAH_OFFSETOF (save_state_t, ss_fpblock) 
-		+ (DEPRECATED_REGISTER_BYTE (regno) - DEPRECATED_REGISTER_BYTE (HPPA_FP0_REGNUM)));
+	addr = HPPAH_OFFSETOF (save_state_t, ss_fpblock) 
+	       + ((regno - HPPA_FP0_REGNUM) 
+	          * register_size (current_gdbarch, regno));
 
       /* Wide registers come from the ss_wide area.
 	 I think it's more PC to test (ss_flags & SS_WIDEREGS) to select
@@ -123,14 +124,14 @@ store_inferior_registers (int regno)
 	 But checking ss_flags would require an extra ptrace call for
 	 every register reference.  Bleah.  */
       else if (len == 8)
-	addr = (HPPAH_OFFSETOF (save_state_t, ss_wide) 
-		+ DEPRECATED_REGISTER_BYTE (regno));
+	addr = HPPAH_OFFSETOF (save_state_t, ss_wide) 
+	       + regno * 8;
 
       /* Narrow registers come from the ss_narrow area.  Note that
 	 ss_narrow starts with gr1, not gr0.  */
       else if (len == 4)
-	addr = (HPPAH_OFFSETOF (save_state_t, ss_narrow)
-		+ (DEPRECATED_REGISTER_BYTE (regno) - DEPRECATED_REGISTER_BYTE (1)));
+	addr = HPPAH_OFFSETOF (save_state_t, ss_narrow)
+	       + (regno - 1) * 4;
       else
 	internal_error (__FILE__, __LINE__,
 			"hppah-nat.c (write_register): unexpected register size");
-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/


                 reply	other threads:[~2004-12-06  3:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20041206033618.GD6359@tausq.org \
    --to=randolph@tausq.org \
    --cc=gdb-patches@sources.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