This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]