From: Andrew Cagney <ac131313@ges.redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [rfa:m68hc11] Switch m68hc11 to cooked registers
Date: Fri, 02 Aug 2002 09:04:00 -0000 [thread overview]
Message-ID: <3D4AAD71.4050403@ges.redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 183 bytes --]
Hello,
The attached patch tries to switch the m68hc11 to the new cooked
register framework.
It certainly compiles and looks ok (....) but I've not tested it.
ok to commit?
Andrew
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 2557 bytes --]
Index: ChangeLog
2002-08-02 Andrew Cagney <cagney@redhat.com>
* m68hc11-tdep.c (m68hc11_pseudo_register_read): Replace
m68hc11_fetch_pseudo_register.
(m68hc11_pseudo_register_write): Replace
m68hc11_store_pseudo_register.
(m68hc11_gdbarch_init): Update.
Index: m68hc11-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m68hc11-tdep.c,v
retrieving revision 1.22
diff -u -r1.22 m68hc11-tdep.c
--- m68hc11-tdep.c 29 Jul 2002 16:34:06 -0000 1.22
+++ m68hc11-tdep.c 2 Aug 2002 15:58:37 -0000
@@ -218,11 +218,11 @@
/* Fetch a pseudo register. The 68hc11 soft registers are treated like
pseudo registers. They are located in memory. Translate the register
fetch into a memory read. */
-void
-m68hc11_fetch_pseudo_register (int regno)
+static void
+m68hc11_pseudo_register_read (struct gdbarch *gdbarch,
+ struct regcache *regcache,
+ int regno, void *buf)
{
- char buf[MAX_REGISTER_RAW_SIZE];
-
m68hc11_initialize_register_info ();
/* Fetch a soft register: translate into a memory read. */
@@ -234,23 +234,24 @@
{
memset (buf, 0, 2);
}
- supply_register (regno, buf);
}
/* Store a pseudo register. Translate the register store
into a memory write. */
static void
-m68hc11_store_pseudo_register (int regno)
+m68hc11_pseudo_register_write (struct gdbarch *gdbarch,
+ struct regcache *regcache,
+ int regno, const void *buf)
{
m68hc11_initialize_register_info ();
/* Store a soft register: translate into a memory write. */
if (soft_regs[regno].name)
{
- char buf[MAX_REGISTER_RAW_SIZE];
-
- read_register_gen (regno, buf);
- target_write_memory (soft_regs[regno].addr, buf, 2);
+ const int regsize = 2;
+ char *tmp = alloca (regsize);
+ memcpy (tmp, buf, regsize);
+ target_write_memory (soft_regs[regno].addr, tmp, regsize);
}
}
@@ -1098,8 +1099,8 @@
set_gdbarch_register_size (gdbarch, 2);
set_gdbarch_register_bytes (gdbarch, M68HC11_ALL_REGS * 2);
set_gdbarch_register_virtual_type (gdbarch, m68hc11_register_virtual_type);
- set_gdbarch_fetch_pseudo_register (gdbarch, m68hc11_fetch_pseudo_register);
- set_gdbarch_store_pseudo_register (gdbarch, m68hc11_store_pseudo_register);
+ set_gdbarch_pseudo_register_read (gdbarch, m68hc11_pseudo_register_read);
+ set_gdbarch_pseudo_register_write (gdbarch, m68hc11_pseudo_register_write);
set_gdbarch_use_generic_dummy_frames (gdbarch, 1);
set_gdbarch_call_dummy_length (gdbarch, 0);
next reply other threads:[~2002-08-02 16:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-02 9:04 Andrew Cagney [this message]
2002-08-02 11:44 ` Stephane Carrez
2002-08-03 9:09 ` Andrew Cagney
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=3D4AAD71.4050403@ges.redhat.com \
--to=ac131313@ges.redhat.com \
--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