This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
unnecessary [...]_write_pc functions?
- From: Joel Brobecker <brobecker at adacore dot com>
- To: gdb-patches at sourceware dot org
- Cc: eager at eagercon dot com, green at moxielogic dot com
- Date: Mon, 15 Apr 2013 15:12:17 +0200
- Subject: unnecessary [...]_write_pc functions?
Same as http://www.sourceware.org/ml/gdb-patches/2013-04/msg00407.html
for the following files:
- microblaze-tdep.c
- mn10300-tdep.c
- moxie-tdep.c
For instance with microblaze-tdep.c, we have:
> static void
> microblaze_write_pc (struct regcache *regcache, CORE_ADDR pc)
> {
> regcache_cooked_write_unsigned (regcache, MICROBLAZE_PC_REGNUM, pc);
> }
The only caller of the gdbarch_write_pc function is defined to call...
regcache_cooked_write_unsigned (regcache,
gdbarch_pc_regnum (gdbarch), pc);
... if the gdbarch_write_pc method is not set. Since the pc_regnum
gdbarch value is set to MICROBLAZE_PC_REGNUM, there is no need to
define microblaze_write_pc.
I am happy deleting the _write_pc methods, except that I would not
be able to test the change.
--
Joel