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]

Re: unnecessary [...]_write_pc functions?


On 04/15/2013 06:12 AM, Joel Brobecker wrote:
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.

Hi Joel --

Sorry about the delay responding.

I'm in the middle of switching from one MicroBlaze test board
to another.  I'll test this change when the new board is working.


--
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077


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