From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: gdb-patches@sourceware.org
Subject: [rfc][13/13] Eliminate read_register: Remove definition
Date: Thu, 07 Jun 2007 21:01:00 -0000 [thread overview]
Message-ID: <200706072101.l57L1XNt021564@d12av02.megacenter.de.ibm.com> (raw)
Hello,
this is it! No more users of read_register et al.
Bye,
Ulrich
ChangeLog:
* regcache.c (read_register, read_register_pid): Remove.
(write_register, write_register_pid): Likewise.
* regcache.h (read_register, read_register_pid): Remove prototype.
(write_register, write_register_pid): Likewise.
diff -urNp gdb-orig/gdb/regcache.c gdb-head/gdb/regcache.c
--- gdb-orig/gdb/regcache.c 2007-06-01 18:21:40.033980794 +0200
+++ gdb-head/gdb/regcache.c 2007-06-01 18:21:49.076007604 +0200
@@ -754,73 +754,6 @@ register_offset_hack (struct gdbarch *gd
return descr->register_offset[regnum];
}
-/* Return the contents of register REGNUM as an unsigned integer. */
-
-ULONGEST
-read_register (int regnum)
-{
- gdb_byte *buf = alloca (register_size (current_gdbarch, regnum));
- gdb_assert (current_regcache != NULL);
- gdb_assert (current_regcache->descr->gdbarch == current_gdbarch);
- regcache_cooked_read (current_regcache, regnum, buf);
- return (extract_unsigned_integer (buf, register_size (current_gdbarch, regnum)));
-}
-
-ULONGEST
-read_register_pid (int regnum, ptid_t ptid)
-{
- ptid_t save_ptid;
- int save_pid;
- CORE_ADDR retval;
-
- if (ptid_equal (ptid, inferior_ptid))
- return read_register (regnum);
-
- save_ptid = inferior_ptid;
-
- inferior_ptid = ptid;
-
- retval = read_register (regnum);
-
- inferior_ptid = save_ptid;
-
- return retval;
-}
-
-/* Store VALUE into the raw contents of register number REGNUM. */
-
-void
-write_register (int regnum, LONGEST val)
-{
- void *buf;
- int size;
- size = register_size (current_gdbarch, regnum);
- buf = alloca (size);
- store_signed_integer (buf, size, (LONGEST) val);
- gdb_assert (current_regcache != NULL);
- gdb_assert (current_regcache->descr->gdbarch == current_gdbarch);
- regcache_cooked_write (current_regcache, regnum, buf);
-}
-
-void
-write_register_pid (int regnum, CORE_ADDR val, ptid_t ptid)
-{
- ptid_t save_ptid;
-
- if (ptid_equal (ptid, inferior_ptid))
- {
- write_register (regnum, val);
- return;
- }
-
- save_ptid = inferior_ptid;
-
- inferior_ptid = ptid;
-
- write_register (regnum, val);
-
- inferior_ptid = save_ptid;
-}
/* Supply register REGNUM, whose contents are stored in BUF, to REGCACHE. */
diff -urNp gdb-orig/gdb/regcache.h gdb-head/gdb/regcache.h
--- gdb-orig/gdb/regcache.h 2007-05-15 20:28:59.000000000 +0200
+++ gdb-head/gdb/regcache.h 2007-06-01 18:21:49.118001556 +0200
@@ -161,15 +161,4 @@ extern void regcache_cpy_no_passthrough
extern void registers_changed (void);
-
-/* Rename to read_unsigned_register()? */
-extern ULONGEST read_register (int regnum);
-
-/* Rename to read_unsigned_register_pid()? */
-extern ULONGEST read_register_pid (int regnum, ptid_t ptid);
-
-extern void write_register (int regnum, LONGEST val);
-
-extern void write_register_pid (int regnum, CORE_ADDR val, ptid_t ptid);
-
#endif /* REGCACHE_H */
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
next reply other threads:[~2007-06-07 21:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-07 21:01 Ulrich Weigand [this message]
2007-06-12 13:54 ` Daniel Jacobowitz
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=200706072101.l57L1XNt021564@d12av02.megacenter.de.ibm.com \
--to=uweigand@de.ibm.com \
--cc=gdb-patches@sourceware.org \
/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